
<!doctype html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
      
      
        <link rel="prev" href="../06_Servlet%E5%8F%8AFilter%E5%9F%BA%E7%A1%80%E5%AE%9E%E9%AA%8C/index.html">
      
      
      
      <link rel="icon" href="../../assets/images/favicon.png">
      <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.5">
    
    
      
        <title>07 Spring Boot综合实验 - 基于WEB的应用程序开发-实验指导书</title>
      
    
    
      <link rel="stylesheet" href="../../assets/stylesheets/main.8608ea7d.min.css">
      
        
        <link rel="stylesheet" href="../../assets/stylesheets/palette.06af60db.min.css">
      
      


    
    
      
    
    
      
        
        
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
        <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
      
    
    
      <link rel="stylesheet" href="../../assets/stylesheets/extra.css">
    
    <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
    
      

    
    
    
  </head>
  
  
    
    
      
    
    
    
    
    <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="purple" data-md-color-accent="indigo">
  
    
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" for="__drawer"></label>
    <div data-md-component="skip">
      
        
        <a href="#springboot" class="md-skip">
          Skip to content
        </a>
      
    </div>
    <div data-md-component="announce">
      
    </div>
    
    
      

  

<header class="md-header md-header--shadow" data-md-component="header">
  <nav class="md-header__inner md-grid" aria-label="Header">
    <a href="../../index.html" title="基于WEB的应用程序开发-实验指导书" class="md-header__button md-logo" aria-label="基于WEB的应用程序开发-实验指导书" data-md-component="logo">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>

    </a>
    <label class="md-header__button md-icon" for="__drawer">
      
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
    </label>
    <div class="md-header__title" data-md-component="header-title">
      <div class="md-header__ellipsis">
        <div class="md-header__topic">
          <span class="md-ellipsis">
            基于WEB的应用程序开发-实验指导书
          </span>
        </div>
        <div class="md-header__topic" data-md-component="header-topic">
          <span class="md-ellipsis">
            
              07 Spring Boot综合实验
            
          </span>
        </div>
      </div>
    </div>
    
      
        <form class="md-header__option" data-md-component="palette">
  
    
    
    
    <input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="purple" data-md-color-accent="indigo"  aria-label="夜间模式"  type="radio" name="__palette" id="__palette_0">
    
      <label class="md-header__button md-icon" title="夜间模式" for="__palette_1" hidden>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5s-1.65.15-2.39.42zM3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29zm.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14zM20.65 7l-1.77 3.79a7.02 7.02 0 0 0-2.38-4.15zm-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29zM12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44z"/></svg>
      </label>
    
  
    
    
    
    <input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="indigo"  aria-label="日间模式"  type="radio" name="__palette" id="__palette_1">
    
      <label class="md-header__button md-icon" title="日间模式" for="__palette_0" hidden>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3zm3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95zm-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31"/></svg>
      </label>
    
  
</form>
      
    
    
      <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
    
    
    
    
  </nav>
  
</header>
    
    <div class="md-container" data-md-component="container">
      
      
        
          
        
      
      <main class="md-main" data-md-component="main">
        <div class="md-main__inner md-grid">
          
            
              
              <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    



<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  <label class="md-nav__title" for="__drawer">
    <a href="../../index.html" title="基于WEB的应用程序开发-实验指导书" class="md-nav__button md-logo" aria-label="基于WEB的应用程序开发-实验指导书" data-md-component="logo">
      
  
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>

    </a>
    基于WEB的应用程序开发-实验指导书
  </label>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    首页
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    
    
    
      
        
        
      
    
    
    <li class="md-nav__item md-nav__item--section md-nav__item--nested">
      
        
        
          
        
        <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
        
          
          <label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
            
  
  <span class="md-ellipsis">
    1. 实验环境搭建
    
  </span>
  

            <span class="md-nav__icon md-icon"></span>
          </label>
        
        <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
          <label class="md-nav__title" for="__nav_2">
            <span class="md-nav__icon md-icon"></span>
            1. 实验环境搭建
          </label>
          <ul class="md-nav__list" data-md-scrollfix>
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../../00_%E7%8E%AF%E5%A2%83%E5%BB%BA%E7%AB%8B/Java/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    1.1 前端环境搭建
    
  </span>
  

      </a>
    </li>
  

              
            
              
                
  
  
  
  
    <li class="md-nav__item">
      <a href="../05_%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    1.2 后端境搭建
    
  </span>
  

      </a>
    </li>
  

              
            
          </ul>
        </nav>
      
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../01_Html%E5%9F%BA%E7%A1%80/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    2 Html基础实验
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../02_CSS%E5%9F%BA%E7%A1%80/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    3 CSS基础实验
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../03_Javascript%E5%9F%BA%E7%A1%80/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    04 Javascript基础
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../03_Javascript%E9%AB%98%E7%BA%A7%E5%AE%9E%E9%AA%8C/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    05 Javascript高级实验
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../04_jQuery/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    06 jQuery
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../04_Bootstrap/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    06 Bootstrap
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../../04_Vue.js%E5%9F%BA%E7%A1%80/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    06 Vue.js
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../05_JSP%E7%9A%84%E9%9A%90%E5%90%AB%E5%AF%B9%E8%B1%A1%E5%AE%9E%E9%AA%8C/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    05 JSP的隐含对象实验
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
  
  
    <li class="md-nav__item">
      <a href="../06_Servlet%E5%8F%8AFilter%E5%9F%BA%E7%A1%80%E5%AE%9E%E9%AA%8C/index.html" class="md-nav__link">
        
  
  <span class="md-ellipsis">
    06 Servlet及Filter基础实验
    
  </span>
  

      </a>
    </li>
  

    
      
      
  
  
    
  
  
  
    <li class="md-nav__item md-nav__item--active">
      
      <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
      
      
        
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          
  
  <span class="md-ellipsis">
    07 Spring Boot综合实验
    
  </span>
  

          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="index.html" class="md-nav__link md-nav__link--active">
        
  
  <span class="md-ellipsis">
    07 Spring Boot综合实验
    
  </span>
  

      </a>
      
        

  

<nav class="md-nav md-nav--secondary" aria-label=" ">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
       
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#1" class="md-nav__link">
    <span class="md-ellipsis">
      1 实验类型
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#2" class="md-nav__link">
    <span class="md-ellipsis">
      2 实验目的
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#3" class="md-nav__link">
    <span class="md-ellipsis">
      3 实验要求
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#4" class="md-nav__link">
    <span class="md-ellipsis">
      4 实验环境
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#5" class="md-nav__link">
    <span class="md-ellipsis">
      5 实验步骤
    </span>
  </a>
  
    <nav class="md-nav" aria-label="5 实验步骤">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#spring-boot" class="md-nav__link">
    <span class="md-ellipsis">
      创建Spring Boot项目
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_1" class="md-nav__link">
    <span class="md-ellipsis">
      配置
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_2" class="md-nav__link">
    <span class="md-ellipsis">
      创建学生表
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#crud" class="md-nav__link">
    <span class="md-ellipsis">
      实现CRUD操作
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_3" class="md-nav__link">
    <span class="md-ellipsis">
      测试
    </span>
  </a>
  
    <nav class="md-nav" aria-label="测试">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#_4" class="md-nav__link">
    <span class="md-ellipsis">
      学生表
    </span>
  </a>
  
    <nav class="md-nav" aria-label="学生表">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#_5" class="md-nav__link">
    <span class="md-ellipsis">
      学生表增
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_6" class="md-nav__link">
    <span class="md-ellipsis">
      学生表删
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_7" class="md-nav__link">
    <span class="md-ellipsis">
      学生表改
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_8" class="md-nav__link">
    <span class="md-ellipsis">
      学生表查
    </span>
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_9" class="md-nav__link">
    <span class="md-ellipsis">
      参考文献
    </span>
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              
              <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    

  

<nav class="md-nav md-nav--secondary" aria-label=" ">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
       
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#1" class="md-nav__link">
    <span class="md-ellipsis">
      1 实验类型
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#2" class="md-nav__link">
    <span class="md-ellipsis">
      2 实验目的
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#3" class="md-nav__link">
    <span class="md-ellipsis">
      3 实验要求
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#4" class="md-nav__link">
    <span class="md-ellipsis">
      4 实验环境
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#5" class="md-nav__link">
    <span class="md-ellipsis">
      5 实验步骤
    </span>
  </a>
  
    <nav class="md-nav" aria-label="5 实验步骤">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#spring-boot" class="md-nav__link">
    <span class="md-ellipsis">
      创建Spring Boot项目
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_1" class="md-nav__link">
    <span class="md-ellipsis">
      配置
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_2" class="md-nav__link">
    <span class="md-ellipsis">
      创建学生表
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#crud" class="md-nav__link">
    <span class="md-ellipsis">
      实现CRUD操作
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_3" class="md-nav__link">
    <span class="md-ellipsis">
      测试
    </span>
  </a>
  
    <nav class="md-nav" aria-label="测试">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#_4" class="md-nav__link">
    <span class="md-ellipsis">
      学生表
    </span>
  </a>
  
    <nav class="md-nav" aria-label="学生表">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#_5" class="md-nav__link">
    <span class="md-ellipsis">
      学生表增
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_6" class="md-nav__link">
    <span class="md-ellipsis">
      学生表删
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_7" class="md-nav__link">
    <span class="md-ellipsis">
      学生表改
    </span>
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_8" class="md-nav__link">
    <span class="md-ellipsis">
      学生表查
    </span>
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#_9" class="md-nav__link">
    <span class="md-ellipsis">
      参考文献
    </span>
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          
            <div class="md-content" data-md-component="content">
              <article class="md-content__inner md-typeset">
                
                  



<h1 id="springboot">SpringBoot综合实验</h1>
<h2 id="1">1 实验类型</h2>
<p>验证型，2学时，必选实验</p>
<h2 id="2">2 实验目的</h2>
<p>掌握Spring Boot项目的开发流程</p>
<p>熟悉Spring MVC、MyBatis、Freemarker等框架的使用</p>
<p>熟悉第三方依赖的引入方法</p>
<h2 id="3">3 实验要求</h2>
<p>使用SSM(Spring、Spring MVC、Mybatis)实现学生表的CRUD操作</p>
<blockquote>
<p>可以自行选择框架组合，只要实现CRUD功能即可</p>
</blockquote>
<h2 id="4">4 实验环境</h2>
<p>Windows 7 64、Open JDK 23+、Tomcat 11+、Spring Tools 4(STS4)、Visual Studio Code(VS Code)、Microsoft Edge/Chrome/Firefox等浏览器</p>
<h2 id="5">5 实验步骤</h2>
<h3 id="spring-boot">创建Spring Boot项目</h3>
<ol>
<li>
<p>打开STS4，选择File -&gt; New -&gt; Spring Starter Project</p>
</li>
<li>
<p>输入项目名称，选择Maven项目，选择Spring Boot版本，选择Web、MySQL、MyBatis、Freemarker等依赖，点击Finish按钮创建项目</p>
</li>
<li>
<p>打开<code>pom.xml</code>，手工添加以下依赖：</p>
</li>
</ol>
<table>
<thead>
<tr>
<th>依赖名</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>spring-boot-starter-validation</td>
<td>有效性校验</td>
</tr>
<tr>
<td>validation-api</td>
<td>有效性校验</td>
</tr>
<tr>
<td>poi</td>
<td>POI操作Excel</td>
</tr>
<tr>
<td>poi-ooxml</td>
<td>POI操作Excel</td>
</tr>
<tr>
<td>sqlite-jdbc</td>
<td>Sqlite驱动</td>
</tr>
</tbody>
</table>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/pom.xml</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">  1</a></span>
<span class="normal"><a href="#__codelineno-0-2">  2</a></span>
<span class="normal"><a href="#__codelineno-0-3">  3</a></span>
<span class="normal"><a href="#__codelineno-0-4">  4</a></span>
<span class="normal"><a href="#__codelineno-0-5">  5</a></span>
<span class="normal"><a href="#__codelineno-0-6">  6</a></span>
<span class="normal"><a href="#__codelineno-0-7">  7</a></span>
<span class="normal"><a href="#__codelineno-0-8">  8</a></span>
<span class="normal"><a href="#__codelineno-0-9">  9</a></span>
<span class="normal"><a href="#__codelineno-0-10"> 10</a></span>
<span class="normal"><a href="#__codelineno-0-11"> 11</a></span>
<span class="normal"><a href="#__codelineno-0-12"> 12</a></span>
<span class="normal"><a href="#__codelineno-0-13"> 13</a></span>
<span class="normal"><a href="#__codelineno-0-14"> 14</a></span>
<span class="normal"><a href="#__codelineno-0-15"> 15</a></span>
<span class="normal"><a href="#__codelineno-0-16"> 16</a></span>
<span class="normal"><a href="#__codelineno-0-17"> 17</a></span>
<span class="normal"><a href="#__codelineno-0-18"> 18</a></span>
<span class="normal"><a href="#__codelineno-0-19"> 19</a></span>
<span class="normal"><a href="#__codelineno-0-20"> 20</a></span>
<span class="normal"><a href="#__codelineno-0-21"> 21</a></span>
<span class="normal"><a href="#__codelineno-0-22"> 22</a></span>
<span class="normal"><a href="#__codelineno-0-23"> 23</a></span>
<span class="normal"><a href="#__codelineno-0-24"> 24</a></span>
<span class="normal"><a href="#__codelineno-0-25"> 25</a></span>
<span class="normal"><a href="#__codelineno-0-26"> 26</a></span>
<span class="normal"><a href="#__codelineno-0-27"> 27</a></span>
<span class="normal"><a href="#__codelineno-0-28"> 28</a></span>
<span class="normal"><a href="#__codelineno-0-29"> 29</a></span>
<span class="normal"><a href="#__codelineno-0-30"> 30</a></span>
<span class="normal"><a href="#__codelineno-0-31"> 31</a></span>
<span class="normal"><a href="#__codelineno-0-32"> 32</a></span>
<span class="normal"><a href="#__codelineno-0-33"> 33</a></span>
<span class="normal"><a href="#__codelineno-0-34"> 34</a></span>
<span class="normal"><a href="#__codelineno-0-35"> 35</a></span>
<span class="normal"><a href="#__codelineno-0-36"> 36</a></span>
<span class="normal"><a href="#__codelineno-0-37"> 37</a></span>
<span class="normal"><a href="#__codelineno-0-38"> 38</a></span>
<span class="normal"><a href="#__codelineno-0-39"> 39</a></span>
<span class="normal"><a href="#__codelineno-0-40"> 40</a></span>
<span class="normal"><a href="#__codelineno-0-41"> 41</a></span>
<span class="normal"><a href="#__codelineno-0-42"> 42</a></span>
<span class="normal"><a href="#__codelineno-0-43"> 43</a></span>
<span class="normal"><a href="#__codelineno-0-44"> 44</a></span>
<span class="normal"><a href="#__codelineno-0-45"> 45</a></span>
<span class="normal"><a href="#__codelineno-0-46"> 46</a></span>
<span class="normal"><a href="#__codelineno-0-47"> 47</a></span>
<span class="normal"><a href="#__codelineno-0-48"> 48</a></span>
<span class="normal"><a href="#__codelineno-0-49"> 49</a></span>
<span class="normal"><a href="#__codelineno-0-50"> 50</a></span>
<span class="normal"><a href="#__codelineno-0-51"> 51</a></span>
<span class="normal"><a href="#__codelineno-0-52"> 52</a></span>
<span class="normal"><a href="#__codelineno-0-53"> 53</a></span>
<span class="normal"><a href="#__codelineno-0-54"> 54</a></span>
<span class="normal"><a href="#__codelineno-0-55"> 55</a></span>
<span class="normal"><a href="#__codelineno-0-56"> 56</a></span>
<span class="normal"><a href="#__codelineno-0-57"> 57</a></span>
<span class="normal"><a href="#__codelineno-0-58"> 58</a></span>
<span class="normal"><a href="#__codelineno-0-59"> 59</a></span>
<span class="normal"><a href="#__codelineno-0-60"> 60</a></span>
<span class="normal"><a href="#__codelineno-0-61"> 61</a></span>
<span class="normal"><a href="#__codelineno-0-62"> 62</a></span>
<span class="normal"><a href="#__codelineno-0-63"> 63</a></span>
<span class="normal"><a href="#__codelineno-0-64"> 64</a></span>
<span class="normal"><a href="#__codelineno-0-65"> 65</a></span>
<span class="normal"><a href="#__codelineno-0-66"> 66</a></span>
<span class="normal"><a href="#__codelineno-0-67"> 67</a></span>
<span class="normal"><a href="#__codelineno-0-68"> 68</a></span>
<span class="normal"><a href="#__codelineno-0-69"> 69</a></span>
<span class="normal"><a href="#__codelineno-0-70"> 70</a></span>
<span class="normal"><a href="#__codelineno-0-71"> 71</a></span>
<span class="normal"><a href="#__codelineno-0-72"> 72</a></span>
<span class="normal"><a href="#__codelineno-0-73"> 73</a></span>
<span class="normal"><a href="#__codelineno-0-74"> 74</a></span>
<span class="normal"><a href="#__codelineno-0-75"> 75</a></span>
<span class="normal"><a href="#__codelineno-0-76"> 76</a></span>
<span class="normal"><a href="#__codelineno-0-77"> 77</a></span>
<span class="normal"><a href="#__codelineno-0-78"> 78</a></span>
<span class="normal"><a href="#__codelineno-0-79"> 79</a></span>
<span class="normal"><a href="#__codelineno-0-80"> 80</a></span>
<span class="normal"><a href="#__codelineno-0-81"> 81</a></span>
<span class="normal"><a href="#__codelineno-0-82"> 82</a></span>
<span class="normal"><a href="#__codelineno-0-83"> 83</a></span>
<span class="normal"><a href="#__codelineno-0-84"> 84</a></span>
<span class="normal"><a href="#__codelineno-0-85"> 85</a></span>
<span class="normal"><a href="#__codelineno-0-86"> 86</a></span>
<span class="normal"><a href="#__codelineno-0-87"> 87</a></span>
<span class="normal"><a href="#__codelineno-0-88"> 88</a></span>
<span class="normal"><a href="#__codelineno-0-89"> 89</a></span>
<span class="normal"><a href="#__codelineno-0-90"> 90</a></span>
<span class="normal"><a href="#__codelineno-0-91"> 91</a></span>
<span class="normal"><a href="#__codelineno-0-92"> 92</a></span>
<span class="normal"><a href="#__codelineno-0-93"> 93</a></span>
<span class="normal"><a href="#__codelineno-0-94"> 94</a></span>
<span class="normal"><a href="#__codelineno-0-95"> 95</a></span>
<span class="normal"><a href="#__codelineno-0-96"> 96</a></span>
<span class="normal"><a href="#__codelineno-0-97"> 97</a></span>
<span class="normal"><a href="#__codelineno-0-98"> 98</a></span>
<span class="normal"><a href="#__codelineno-0-99"> 99</a></span>
<span class="normal"><a href="#__codelineno-0-100">100</a></span>
<span class="normal"><a href="#__codelineno-0-101">101</a></span>
<span class="normal"><a href="#__codelineno-0-102">102</a></span>
<span class="normal"><a href="#__codelineno-0-103">103</a></span>
<span class="normal"><a href="#__codelineno-0-104">104</a></span>
<span class="normal"><a href="#__codelineno-0-105">105</a></span>
<span class="normal"><a href="#__codelineno-0-106">106</a></span>
<span class="normal"><a href="#__codelineno-0-107">107</a></span>
<span class="normal"><a href="#__codelineno-0-108">108</a></span>
<span class="normal"><a href="#__codelineno-0-109">109</a></span>
<span class="normal"><a href="#__codelineno-0-110">110</a></span>
<span class="normal"><a href="#__codelineno-0-111">111</a></span>
<span class="normal"><a href="#__codelineno-0-112">112</a></span>
<span class="normal"><a href="#__codelineno-0-113">113</a></span>
<span class="normal"><a href="#__codelineno-0-114">114</a></span>
<span class="normal"><a href="#__codelineno-0-115">115</a></span>
<span class="normal"><a href="#__codelineno-0-116">116</a></span>
<span class="normal"><a href="#__codelineno-0-117">117</a></span>
<span class="normal"><a href="#__codelineno-0-118">118</a></span>
<span class="normal"><a href="#__codelineno-0-119">119</a></span>
<span class="normal"><a href="#__codelineno-0-120">120</a></span>
<span class="normal"><a href="#__codelineno-0-121">121</a></span>
<span class="normal"><a href="#__codelineno-0-122">122</a></span>
<span class="normal"><a href="#__codelineno-0-123">123</a></span>
<span class="normal"><a href="#__codelineno-0-124">124</a></span>
<span class="normal"><a href="#__codelineno-0-125">125</a></span>
<span class="normal"><a href="#__codelineno-0-126">126</a></span>
<span class="normal"><a href="#__codelineno-0-127">127</a></span>
<span class="normal"><a href="#__codelineno-0-128">128</a></span>
<span class="normal"><a href="#__codelineno-0-129">129</a></span>
<span class="normal"><a href="#__codelineno-0-130">130</a></span>
<span class="normal"><a href="#__codelineno-0-131">131</a></span>
<span class="normal"><a href="#__codelineno-0-132">132</a></span>
<span class="normal"><a href="#__codelineno-0-133">133</a></span>
<span class="normal"><a href="#__codelineno-0-134">134</a></span>
<span class="normal"><a href="#__codelineno-0-135">135</a></span>
<span class="normal"><a href="#__codelineno-0-136">136</a></span>
<span class="normal"><a href="#__codelineno-0-137">137</a></span>
<span class="normal"><a href="#__codelineno-0-138">138</a></span>
<span class="normal"><a href="#__codelineno-0-139">139</a></span>
<span class="normal"><a href="#__codelineno-0-140">140</a></span>
<span class="normal"><a href="#__codelineno-0-141">141</a></span>
<span class="normal"><a href="#__codelineno-0-142">142</a></span>
<span class="normal"><a href="#__codelineno-0-143">143</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<a id="__codelineno-0-2" name="__codelineno-0-2"></a><span class="nt">&lt;project</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://maven.apache.org/POM/4.0.0&quot;</span>
<a id="__codelineno-0-3" name="__codelineno-0-3"></a><span class="w">  </span><span class="na">xmlns:xsi=</span><span class="s">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
<a id="__codelineno-0-4" name="__codelineno-0-4"></a><span class="w">  </span><span class="na">xsi:schemaLocation=</span><span class="s">&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-0-5" name="__codelineno-0-5"></a><span class="w">  </span><span class="nt">&lt;modelVersion&gt;</span>4.0.0<span class="nt">&lt;/modelVersion&gt;</span>
<a id="__codelineno-0-6" name="__codelineno-0-6"></a><span class="w">  </span><span class="nt">&lt;parent&gt;</span>
<a id="__codelineno-0-7" name="__codelineno-0-7"></a><span class="w">    </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-8" name="__codelineno-0-8"></a><span class="w">    </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-starter-parent<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-9" name="__codelineno-0-9"></a><span class="w">    </span><span class="nt">&lt;version&gt;</span>3.0.6<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-10" name="__codelineno-0-10"></a><span class="w">    </span><span class="nt">&lt;relativePath</span><span class="w"> </span><span class="nt">/&gt;</span><span class="w"> </span><span class="cm">&lt;!-- lookup parent from repository --&gt;</span>
<a id="__codelineno-0-11" name="__codelineno-0-11"></a><span class="w">  </span><span class="nt">&lt;/parent&gt;</span>
<a id="__codelineno-0-12" name="__codelineno-0-12"></a><span class="w">  </span><span class="nt">&lt;groupId&gt;</span>xust<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-13" name="__codelineno-0-13"></a><span class="w">  </span><span class="nt">&lt;artifactId&gt;</span>Stu<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-14" name="__codelineno-0-14"></a><span class="w">  </span><span class="nt">&lt;version&gt;</span>0.0.1-SNAPSHOT<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-15" name="__codelineno-0-15"></a><span class="w">  </span><span class="nt">&lt;name&gt;</span>Stu<span class="nt">&lt;/name&gt;</span>
<a id="__codelineno-0-16" name="__codelineno-0-16"></a><span class="w">  </span><span class="nt">&lt;description&gt;</span>Stu<span class="nt">&lt;/description&gt;</span>
<a id="__codelineno-0-17" name="__codelineno-0-17"></a><span class="w">  </span><span class="nt">&lt;properties&gt;</span>
<a id="__codelineno-0-18" name="__codelineno-0-18"></a><span class="w">    </span><span class="nt">&lt;java.version&gt;</span>17<span class="nt">&lt;/java.version&gt;</span>
<a id="__codelineno-0-19" name="__codelineno-0-19"></a><span class="w">  </span><span class="nt">&lt;/properties&gt;</span>
<a id="__codelineno-0-20" name="__codelineno-0-20"></a><span class="w">  </span><span class="nt">&lt;dependencies&gt;</span>
<a id="__codelineno-0-21" name="__codelineno-0-21"></a><span class="w">    </span><span class="cm">&lt;!-- Starter for building MVC web applications using FreeMarker views --&gt;</span>
<a id="__codelineno-0-22" name="__codelineno-0-22"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-23" name="__codelineno-0-23"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-24" name="__codelineno-0-24"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-starter-freemarker<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-25" name="__codelineno-0-25"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-26" name="__codelineno-0-26"></a><span class="w">    </span><span class="cm">&lt;!-- Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat</span>
<a id="__codelineno-0-27" name="__codelineno-0-27"></a><span class="cm">    as the default embedded container --&gt;</span>
<a id="__codelineno-0-28" name="__codelineno-0-28"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-29" name="__codelineno-0-29"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-30" name="__codelineno-0-30"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-starter-web<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-31" name="__codelineno-0-31"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-32" name="__codelineno-0-32"></a><span class="w">    </span><span class="cm">&lt;!-- 有效性校验 --&gt;</span>
<a id="__codelineno-0-33" name="__codelineno-0-33"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-34" name="__codelineno-0-34"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-35" name="__codelineno-0-35"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-starter-validation<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-36" name="__codelineno-0-36"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-37" name="__codelineno-0-37"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-38" name="__codelineno-0-38"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>javax.validation<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-39" name="__codelineno-0-39"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>validation-api<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-40" name="__codelineno-0-40"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>2.0.1.Final<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-41" name="__codelineno-0-41"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-42" name="__codelineno-0-42"></a><span class="w">    </span><span class="cm">&lt;!-- MyBatis Spring Boot Starter --&gt;</span>
<a id="__codelineno-0-43" name="__codelineno-0-43"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-44" name="__codelineno-0-44"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.mybatis.spring.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-45" name="__codelineno-0-45"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>mybatis-spring-boot-starter<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-46" name="__codelineno-0-46"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>3.0.1<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-47" name="__codelineno-0-47"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-48" name="__codelineno-0-48"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-49" name="__codelineno-0-49"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.mybatis.spring.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-50" name="__codelineno-0-50"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>mybatis-spring-boot-starter-test<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-51" name="__codelineno-0-51"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>3.0.1<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-52" name="__codelineno-0-52"></a><span class="w">      </span><span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
<a id="__codelineno-0-53" name="__codelineno-0-53"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-54" name="__codelineno-0-54"></a><span class="w">    </span><span class="cm">&lt;!-- POI操作Excel --&gt;</span>
<a id="__codelineno-0-55" name="__codelineno-0-55"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-56" name="__codelineno-0-56"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.apache.poi<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-57" name="__codelineno-0-57"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>poi<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-58" name="__codelineno-0-58"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>5.2.3<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-59" name="__codelineno-0-59"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-60" name="__codelineno-0-60"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-61" name="__codelineno-0-61"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.apache.poi<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-62" name="__codelineno-0-62"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>poi-ooxml<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-63" name="__codelineno-0-63"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>5.2.3<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-64" name="__codelineno-0-64"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-65" name="__codelineno-0-65"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-66" name="__codelineno-0-66"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.apache.poi<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-67" name="__codelineno-0-67"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>poi-ooxml-schemas<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-68" name="__codelineno-0-68"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>4.1.2<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-69" name="__codelineno-0-69"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-70" name="__codelineno-0-70"></a><span class="w">    </span><span class="cm">&lt;!-- SQLite JDBC is a library for accessing and creating SQLite database files in Java (it</span>
<a id="__codelineno-0-71" name="__codelineno-0-71"></a><span class="cm">    includes native libraries) --&gt;</span>
<a id="__codelineno-0-72" name="__codelineno-0-72"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-73" name="__codelineno-0-73"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.xerial<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-74" name="__codelineno-0-74"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>sqlite-jdbc<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-75" name="__codelineno-0-75"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>3.41.2.1<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-76" name="__codelineno-0-76"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-77" name="__codelineno-0-77"></a><span class="w">    </span><span class="cm">&lt;!-- 单元测试 --&gt;</span>
<a id="__codelineno-0-78" name="__codelineno-0-78"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-79" name="__codelineno-0-79"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>junit<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-80" name="__codelineno-0-80"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>junit<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-81" name="__codelineno-0-81"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>4.13.2<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-82" name="__codelineno-0-82"></a><span class="w">      </span><span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
<a id="__codelineno-0-83" name="__codelineno-0-83"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-84" name="__codelineno-0-84"></a><span class="w">    </span><span class="cm">&lt;!-- MyBatis 分页插件 PageHelper --&gt;</span>
<a id="__codelineno-0-85" name="__codelineno-0-85"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-86" name="__codelineno-0-86"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>com.github.pagehelper<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-87" name="__codelineno-0-87"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>pagehelper-spring-boot-starter<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-88" name="__codelineno-0-88"></a><span class="w">      </span><span class="nt">&lt;version&gt;</span>1.2.4<span class="nt">&lt;/version&gt;</span>
<a id="__codelineno-0-89" name="__codelineno-0-89"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-90" name="__codelineno-0-90"></a><span class="w">    </span><span class="cm">&lt;!-- JDBC Type 4 driver for MySQL. --&gt;</span>
<a id="__codelineno-0-91" name="__codelineno-0-91"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-92" name="__codelineno-0-92"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>com.mysql<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-93" name="__codelineno-0-93"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>mysql-connector-j<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-94" name="__codelineno-0-94"></a><span class="w">      </span><span class="nt">&lt;scope&gt;</span>runtime<span class="nt">&lt;/scope&gt;</span>
<a id="__codelineno-0-95" name="__codelineno-0-95"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-96" name="__codelineno-0-96"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-97" name="__codelineno-0-97"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-98" name="__codelineno-0-98"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-devtools<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-99" name="__codelineno-0-99"></a><span class="w">      </span><span class="nt">&lt;scope&gt;</span>runtime<span class="nt">&lt;/scope&gt;</span>
<a id="__codelineno-0-100" name="__codelineno-0-100"></a><span class="w">      </span><span class="nt">&lt;optional&gt;</span>true<span class="nt">&lt;/optional&gt;</span>
<a id="__codelineno-0-101" name="__codelineno-0-101"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-102" name="__codelineno-0-102"></a><span class="w">    </span><span class="nt">&lt;dependency&gt;</span>
<a id="__codelineno-0-103" name="__codelineno-0-103"></a><span class="w">      </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-104" name="__codelineno-0-104"></a><span class="w">      </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-starter-test<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-105" name="__codelineno-0-105"></a><span class="w">      </span><span class="nt">&lt;scope&gt;</span>test<span class="nt">&lt;/scope&gt;</span>
<a id="__codelineno-0-106" name="__codelineno-0-106"></a><span class="w">    </span><span class="nt">&lt;/dependency&gt;</span>
<a id="__codelineno-0-107" name="__codelineno-0-107"></a><span class="w">  </span><span class="nt">&lt;/dependencies&gt;</span>
<a id="__codelineno-0-108" name="__codelineno-0-108"></a><span class="w">  </span><span class="cm">&lt;!-- 修改maven远程仓库为国内服务器 --&gt;</span>
<a id="__codelineno-0-109" name="__codelineno-0-109"></a><span class="w">  </span><span class="nt">&lt;repositories&gt;</span>
<a id="__codelineno-0-110" name="__codelineno-0-110"></a><span class="w">    </span><span class="nt">&lt;repository&gt;</span>
<a id="__codelineno-0-111" name="__codelineno-0-111"></a><span class="w">      </span><span class="nt">&lt;id&gt;</span>public<span class="nt">&lt;/id&gt;</span>
<a id="__codelineno-0-112" name="__codelineno-0-112"></a><span class="w">      </span><span class="nt">&lt;name&gt;</span>common<span class="w"> </span>central<span class="nt">&lt;/name&gt;</span>
<a id="__codelineno-0-113" name="__codelineno-0-113"></a><span class="w">      </span><span class="nt">&lt;url&gt;</span>http://maven.aliyun.com/nexus/content/groups/public<span class="nt">&lt;/url&gt;</span>
<a id="__codelineno-0-114" name="__codelineno-0-114"></a><span class="w">      </span><span class="nt">&lt;releases&gt;</span>
<a id="__codelineno-0-115" name="__codelineno-0-115"></a><span class="w">        </span><span class="nt">&lt;enabled&gt;</span>true<span class="nt">&lt;/enabled&gt;</span>
<a id="__codelineno-0-116" name="__codelineno-0-116"></a><span class="w">      </span><span class="nt">&lt;/releases&gt;</span>
<a id="__codelineno-0-117" name="__codelineno-0-117"></a><span class="w">      </span><span class="nt">&lt;snapshots&gt;</span>
<a id="__codelineno-0-118" name="__codelineno-0-118"></a><span class="w">        </span><span class="nt">&lt;enabled&gt;</span>true<span class="nt">&lt;/enabled&gt;</span>
<a id="__codelineno-0-119" name="__codelineno-0-119"></a><span class="w">      </span><span class="nt">&lt;/snapshots&gt;</span>
<a id="__codelineno-0-120" name="__codelineno-0-120"></a><span class="w">    </span><span class="nt">&lt;/repository&gt;</span>
<a id="__codelineno-0-121" name="__codelineno-0-121"></a><span class="w">  </span><span class="nt">&lt;/repositories&gt;</span>
<a id="__codelineno-0-122" name="__codelineno-0-122"></a><span class="w">  </span><span class="nt">&lt;pluginRepositories&gt;</span>
<a id="__codelineno-0-123" name="__codelineno-0-123"></a><span class="w">    </span><span class="nt">&lt;pluginRepository&gt;</span>
<a id="__codelineno-0-124" name="__codelineno-0-124"></a><span class="w">      </span><span class="nt">&lt;id&gt;</span>public<span class="nt">&lt;/id&gt;</span>
<a id="__codelineno-0-125" name="__codelineno-0-125"></a><span class="w">      </span><span class="nt">&lt;name&gt;</span>common<span class="w"> </span>central<span class="nt">&lt;/name&gt;</span>
<a id="__codelineno-0-126" name="__codelineno-0-126"></a><span class="w">      </span><span class="nt">&lt;url&gt;</span>http://maven.aliyun.com/nexus/content/groups/public<span class="nt">&lt;/url&gt;</span>
<a id="__codelineno-0-127" name="__codelineno-0-127"></a><span class="w">      </span><span class="nt">&lt;releases&gt;</span>
<a id="__codelineno-0-128" name="__codelineno-0-128"></a><span class="w">        </span><span class="nt">&lt;enabled&gt;</span>true<span class="nt">&lt;/enabled&gt;</span>
<a id="__codelineno-0-129" name="__codelineno-0-129"></a><span class="w">      </span><span class="nt">&lt;/releases&gt;</span>
<a id="__codelineno-0-130" name="__codelineno-0-130"></a><span class="w">      </span><span class="nt">&lt;snapshots&gt;</span>
<a id="__codelineno-0-131" name="__codelineno-0-131"></a><span class="w">        </span><span class="nt">&lt;enabled&gt;</span>true<span class="nt">&lt;/enabled&gt;</span>
<a id="__codelineno-0-132" name="__codelineno-0-132"></a><span class="w">      </span><span class="nt">&lt;/snapshots&gt;</span>
<a id="__codelineno-0-133" name="__codelineno-0-133"></a><span class="w">    </span><span class="nt">&lt;/pluginRepository&gt;</span>
<a id="__codelineno-0-134" name="__codelineno-0-134"></a><span class="w">  </span><span class="nt">&lt;/pluginRepositories&gt;</span>
<a id="__codelineno-0-135" name="__codelineno-0-135"></a><span class="w">  </span><span class="nt">&lt;build&gt;</span>
<a id="__codelineno-0-136" name="__codelineno-0-136"></a><span class="w">    </span><span class="nt">&lt;plugins&gt;</span>
<a id="__codelineno-0-137" name="__codelineno-0-137"></a><span class="w">      </span><span class="nt">&lt;plugin&gt;</span>
<a id="__codelineno-0-138" name="__codelineno-0-138"></a><span class="w">        </span><span class="nt">&lt;groupId&gt;</span>org.springframework.boot<span class="nt">&lt;/groupId&gt;</span>
<a id="__codelineno-0-139" name="__codelineno-0-139"></a><span class="w">        </span><span class="nt">&lt;artifactId&gt;</span>spring-boot-maven-plugin<span class="nt">&lt;/artifactId&gt;</span>
<a id="__codelineno-0-140" name="__codelineno-0-140"></a><span class="w">      </span><span class="nt">&lt;/plugin&gt;</span>
<a id="__codelineno-0-141" name="__codelineno-0-141"></a><span class="w">    </span><span class="nt">&lt;/plugins&gt;</span>
<a id="__codelineno-0-142" name="__codelineno-0-142"></a><span class="w">  </span><span class="nt">&lt;/build&gt;</span>
<a id="__codelineno-0-143" name="__codelineno-0-143"></a><span class="nt">&lt;/project&gt;</span>
</code></pre></div></td></tr></table></div>
<h3 id="_1">配置</h3>
<ol>
<li>
<p>打开<code>application.properties</code>文件，配置Sqlite数据库连接信息，如下所示：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/resources/application.properties</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-1-1">1</a></span>
<span class="normal"><a href="#__codelineno-1-2">2</a></span>
<span class="normal"><a href="#__codelineno-1-3">3</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1"></a><span class="c1"># sqlite</span>
<a id="__codelineno-1-2" name="__codelineno-1-2"></a><span class="na">spring.datasource.url</span><span class="o">=</span><span class="s">jdbc:sqlite:c:/app/sqlite/data</span>
<a id="__codelineno-1-3" name="__codelineno-1-3"></a><span class="na">spring.datasource.driver-class-name</span><span class="o">=</span><span class="s">org.sqlite.JDBC</span>
</code></pre></div></td></tr></table></div>
</li>
<li>
<p>设定Mybatis配置参数，如下所示：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/resources/application.properties</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-2-1">1</a></span>
<span class="normal"><a href="#__codelineno-2-2">2</a></span>
<span class="normal"><a href="#__codelineno-2-3">3</a></span>
<span class="normal"><a href="#__codelineno-2-4">4</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1"></a><span class="c1">#mybatis</span>
<a id="__codelineno-2-2" name="__codelineno-2-2"></a><span class="na">mybatis.type-aliases-package</span><span class="o">=</span><span class="s">xust.stu.**.domain</span>
<a id="__codelineno-2-3" name="__codelineno-2-3"></a><span class="na">mybatis.mapper-locations</span><span class="o">=</span><span class="s">classpath:mapper/*.xml</span>
<a id="__codelineno-2-4" name="__codelineno-2-4"></a><span class="na">mybatis.typeAliasesPackage</span><span class="o">=</span><span class="s">xust.stu.**.domain</span>
</code></pre></div></td></tr></table></div>
</li>
</ol>
<p>完整配置文件如下：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/resources/application.properties</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-3-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-3-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-3-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-3-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-3-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-3-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-3-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-3-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-3-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-3-10">10</a></span>
<span class="normal"><a href="#__codelineno-3-11">11</a></span>
<span class="normal"><a href="#__codelineno-3-12">12</a></span>
<span class="normal"><a href="#__codelineno-3-13">13</a></span>
<span class="normal"><a href="#__codelineno-3-14">14</a></span>
<span class="normal"><a href="#__codelineno-3-15">15</a></span>
<span class="normal"><a href="#__codelineno-3-16">16</a></span>
<span class="normal"><a href="#__codelineno-3-17">17</a></span>
<span class="normal"><a href="#__codelineno-3-18">18</a></span>
<span class="normal"><a href="#__codelineno-3-19">19</a></span>
<span class="normal"><a href="#__codelineno-3-20">20</a></span>
<span class="normal"><a href="#__codelineno-3-21">21</a></span>
<span class="normal"><a href="#__codelineno-3-22">22</a></span>
<span class="normal"><a href="#__codelineno-3-23">23</a></span>
<span class="normal"><a href="#__codelineno-3-24">24</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1"></a><span class="na">server.port</span><span class="o">=</span><span class="s">8080</span>
<a id="__codelineno-3-2" name="__codelineno-3-2"></a><span class="na">server.address</span><span class="o">=</span><span class="s">0.0.0.0</span>
<a id="__codelineno-3-3" name="__codelineno-3-3"></a><span class="na">server.servlet.context-path</span><span class="o">=</span><span class="s">/</span>
<a id="__codelineno-3-4" name="__codelineno-3-4"></a><span class="na">spring.profiles.active</span><span class="o">=</span><span class="s">dev</span>
<a id="__codelineno-3-5" name="__codelineno-3-5"></a>
<a id="__codelineno-3-6" name="__codelineno-3-6"></a><span class="c1">## Time zone setting</span>
<a id="__codelineno-3-7" name="__codelineno-3-7"></a><span class="na">spring.jackson.time-zone</span><span class="o">=</span><span class="s">GMT+8</span>
<a id="__codelineno-3-8" name="__codelineno-3-8"></a>
<a id="__codelineno-3-9" name="__codelineno-3-9"></a><span class="c1">#mybatis</span>
<a id="__codelineno-3-10" name="__codelineno-3-10"></a><span class="na">mybatis.type-aliases-package</span><span class="o">=</span><span class="s">xust.stu.**.domain</span>
<a id="__codelineno-3-11" name="__codelineno-3-11"></a><span class="na">mybatis.mapper-locations</span><span class="o">=</span><span class="s">classpath:mapper/*.xml</span>
<a id="__codelineno-3-12" name="__codelineno-3-12"></a><span class="na">mybatis.typeAliasesPackage</span><span class="o">=</span><span class="s">xust.stu.**.domain</span>
<a id="__codelineno-3-13" name="__codelineno-3-13"></a>
<a id="__codelineno-3-14" name="__codelineno-3-14"></a><span class="c1">#freemarker</span>
<a id="__codelineno-3-15" name="__codelineno-3-15"></a><span class="na">spring.freemarker.charset</span><span class="o">=</span><span class="s">UTF-8</span>
<a id="__codelineno-3-16" name="__codelineno-3-16"></a><span class="na">spring.freemarker.suffix</span><span class="o">=</span><span class="s">.f</span>
<a id="__codelineno-3-17" name="__codelineno-3-17"></a>
<a id="__codelineno-3-18" name="__codelineno-3-18"></a><span class="c1">#Gzip</span>
<a id="__codelineno-3-19" name="__codelineno-3-19"></a><span class="na">server.compression.enabled</span><span class="o">=</span><span class="s">true</span><span class="w">  </span>
<a id="__codelineno-3-20" name="__codelineno-3-20"></a><span class="na">server.compression.mime-types</span><span class="o">=</span><span class="s">text/javascript,application/javascript,text/css</span>
<a id="__codelineno-3-21" name="__codelineno-3-21"></a>
<a id="__codelineno-3-22" name="__codelineno-3-22"></a><span class="c1"># sqlite</span>
<a id="__codelineno-3-23" name="__codelineno-3-23"></a><span class="na">spring.datasource.url</span><span class="o">=</span><span class="s">jdbc:sqlite:c:/app/sqlite/data</span>
<a id="__codelineno-3-24" name="__codelineno-3-24"></a><span class="na">spring.datasource.driver-class-name</span><span class="o">=</span><span class="s">org.sqlite.JDBC</span>
</code></pre></div></td></tr></table></div>
<h3 id="_2">创建学生表</h3>
<ol>
<li>
<p>编写学生表定义及测试数据<code>SQL</code>代码，存放在<code>src/main/resources/sql</code></p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/resources/sql/stu_schema.sql</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-4-1">1</a></span>
<span class="normal"><a href="#__codelineno-4-2">2</a></span>
<span class="normal"><a href="#__codelineno-4-3">3</a></span>
<span class="normal"><a href="#__codelineno-4-4">4</a></span>
<span class="normal"><a href="#__codelineno-4-5">5</a></span>
<span class="normal"><a href="#__codelineno-4-6">6</a></span>
<span class="normal"><a href="#__codelineno-4-7">7</a></span>
<span class="normal"><a href="#__codelineno-4-8">8</a></span>
<span class="normal"><a href="#__codelineno-4-9">9</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1"></a><span class="k">drop</span><span class="w"> </span><span class="k">table</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">exists</span><span class="w"> </span><span class="n">STUDENT</span><span class="p">;</span>
<a id="__codelineno-4-2" name="__codelineno-4-2"></a><span class="k">create</span><span class="w"> </span><span class="k">table</span><span class="w"> </span><span class="n">STUDENT</span><span class="p">(</span>
<a id="__codelineno-4-3" name="__codelineno-4-3"></a><span class="w">    </span><span class="n">Id</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">200</span><span class="p">)</span><span class="w"> </span><span class="k">primary</span><span class="w"> </span><span class="k">key</span><span class="p">,</span>
<a id="__codelineno-4-4" name="__codelineno-4-4"></a><span class="w">    </span><span class="k">no</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span><span class="w"> </span><span class="k">unique</span><span class="w">  </span><span class="k">not</span><span class="w"> </span><span class="k">null</span><span class="p">,</span>
<a id="__codelineno-4-5" name="__codelineno-4-5"></a><span class="w">    </span><span class="n">name</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span><span class="w"> </span><span class="k">not</span><span class="w"> </span><span class="k">null</span><span class="p">,</span>
<a id="__codelineno-4-6" name="__codelineno-4-6"></a><span class="w">    </span><span class="n">gender</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span>
<a id="__codelineno-4-7" name="__codelineno-4-7"></a><span class="w">    </span><span class="n">age</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span>
<a id="__codelineno-4-8" name="__codelineno-4-8"></a><span class="w">    </span><span class="n">dept</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<a id="__codelineno-4-9" name="__codelineno-4-9"></a><span class="p">);</span>
</code></pre></div></td></tr></table></div>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/resources/sql/stu_data.sql</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-5-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-5-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-5-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-5-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-5-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-5-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-5-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-5-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-5-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-5-10">10</a></span>
<span class="normal"><a href="#__codelineno-5-11">11</a></span>
<span class="normal"><a href="#__codelineno-5-12">12</a></span>
<span class="normal"><a href="#__codelineno-5-13">13</a></span>
<span class="normal"><a href="#__codelineno-5-14">14</a></span>
<span class="normal"><a href="#__codelineno-5-15">15</a></span>
<span class="normal"><a href="#__codelineno-5-16">16</a></span>
<span class="normal"><a href="#__codelineno-5-17">17</a></span>
<span class="normal"><a href="#__codelineno-5-18">18</a></span>
<span class="normal"><a href="#__codelineno-5-19">19</a></span>
<span class="normal"><a href="#__codelineno-5-20">20</a></span>
<span class="normal"><a href="#__codelineno-5-21">21</a></span>
<span class="normal"><a href="#__codelineno-5-22">22</a></span>
<span class="normal"><a href="#__codelineno-5-23">23</a></span>
<span class="normal"><a href="#__codelineno-5-24">24</a></span>
<span class="normal"><a href="#__codelineno-5-25">25</a></span>
<span class="normal"><a href="#__codelineno-5-26">26</a></span>
<span class="normal"><a href="#__codelineno-5-27">27</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1"></a><span class="k">delete</span><span class="w"> </span><span class="k">from</span><span class="w"> </span><span class="n">STUDENT</span><span class="p">;</span>
<a id="__codelineno-5-2" name="__codelineno-5-2"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-3" name="__codelineno-5-3"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X0&#39;</span><span class="p">,</span><span class="s1">&#39;X0&#39;</span><span class="p">,</span><span class="s1">&#39;X0&#39;</span><span class="p">,</span><span class="s1">&#39;X0&#39;</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="s1">&#39;X0&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-4" name="__codelineno-5-4"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-5" name="__codelineno-5-5"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X1&#39;</span><span class="p">,</span><span class="s1">&#39;X1&#39;</span><span class="p">,</span><span class="s1">&#39;X1&#39;</span><span class="p">,</span><span class="s1">&#39;X1&#39;</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="s1">&#39;X1&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-6" name="__codelineno-5-6"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-7" name="__codelineno-5-7"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X2&#39;</span><span class="p">,</span><span class="s1">&#39;X2&#39;</span><span class="p">,</span><span class="s1">&#39;X2&#39;</span><span class="p">,</span><span class="s1">&#39;X2&#39;</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="s1">&#39;X2&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-8" name="__codelineno-5-8"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-9" name="__codelineno-5-9"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X3&#39;</span><span class="p">,</span><span class="s1">&#39;X3&#39;</span><span class="p">,</span><span class="s1">&#39;X3&#39;</span><span class="p">,</span><span class="s1">&#39;X3&#39;</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="s1">&#39;X3&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-10" name="__codelineno-5-10"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-11" name="__codelineno-5-11"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X4&#39;</span><span class="p">,</span><span class="s1">&#39;X4&#39;</span><span class="p">,</span><span class="s1">&#39;X4&#39;</span><span class="p">,</span><span class="s1">&#39;X4&#39;</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="s1">&#39;X4&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-12" name="__codelineno-5-12"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-13" name="__codelineno-5-13"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X5&#39;</span><span class="p">,</span><span class="s1">&#39;X5&#39;</span><span class="p">,</span><span class="s1">&#39;X5&#39;</span><span class="p">,</span><span class="s1">&#39;X5&#39;</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="s1">&#39;X5&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-14" name="__codelineno-5-14"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-15" name="__codelineno-5-15"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X6&#39;</span><span class="p">,</span><span class="s1">&#39;X6&#39;</span><span class="p">,</span><span class="s1">&#39;X6&#39;</span><span class="p">,</span><span class="s1">&#39;X6&#39;</span><span class="p">,</span><span class="mi">6</span><span class="p">,</span><span class="s1">&#39;X6&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-16" name="__codelineno-5-16"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-17" name="__codelineno-5-17"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X7&#39;</span><span class="p">,</span><span class="s1">&#39;X7&#39;</span><span class="p">,</span><span class="s1">&#39;X7&#39;</span><span class="p">,</span><span class="s1">&#39;X7&#39;</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="s1">&#39;X7&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-18" name="__codelineno-5-18"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-19" name="__codelineno-5-19"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X8&#39;</span><span class="p">,</span><span class="s1">&#39;X8&#39;</span><span class="p">,</span><span class="s1">&#39;X8&#39;</span><span class="p">,</span><span class="s1">&#39;X8&#39;</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="s1">&#39;X8&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-20" name="__codelineno-5-20"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-21" name="__codelineno-5-21"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X9&#39;</span><span class="p">,</span><span class="s1">&#39;X9&#39;</span><span class="p">,</span><span class="s1">&#39;X9&#39;</span><span class="p">,</span><span class="s1">&#39;X9&#39;</span><span class="p">,</span><span class="mi">9</span><span class="p">,</span><span class="s1">&#39;X9&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-22" name="__codelineno-5-22"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-23" name="__codelineno-5-23"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X10&#39;</span><span class="p">,</span><span class="s1">&#39;X10&#39;</span><span class="p">,</span><span class="s1">&#39;X10&#39;</span><span class="p">,</span><span class="s1">&#39;X10&#39;</span><span class="p">,</span><span class="mi">10</span><span class="p">,</span><span class="s1">&#39;X10&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-24" name="__codelineno-5-24"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-25" name="__codelineno-5-25"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X11&#39;</span><span class="p">,</span><span class="s1">&#39;X11&#39;</span><span class="p">,</span><span class="s1">&#39;X11&#39;</span><span class="p">,</span><span class="s1">&#39;X11&#39;</span><span class="p">,</span><span class="mi">11</span><span class="p">,</span><span class="s1">&#39;X11&#39;</span><span class="p">);</span><span class="w"> </span>
<a id="__codelineno-5-26" name="__codelineno-5-26"></a><span class="k">insert</span><span class="w"> </span><span class="k">into</span><span class="w"> </span><span class="n">STUDENT</span><span class="w"> </span><span class="p">(</span><span class="n">Id</span><span class="p">,</span><span class="k">no</span><span class="p">,</span><span class="n">name</span><span class="p">,</span><span class="n">gender</span><span class="p">,</span><span class="n">age</span><span class="p">,</span><span class="n">dept</span><span class="p">)</span><span class="w"> </span>
<a id="__codelineno-5-27" name="__codelineno-5-27"></a><span class="k">values</span><span class="w"> </span><span class="p">(</span><span class="s1">&#39;X12&#39;</span><span class="p">,</span><span class="s1">&#39;X12&#39;</span><span class="p">,</span><span class="s1">&#39;X12&#39;</span><span class="p">,</span><span class="s1">&#39;X12&#39;</span><span class="p">,</span><span class="mi">12</span><span class="p">,</span><span class="s1">&#39;X12&#39;</span><span class="p">);</span><span class="w"> </span>
</code></pre></div></td></tr></table></div>
<blockquote>
<p>前步配置中已设置自动执行这两个脚本</p>
</blockquote>
</li>
<li>
<p>在项目中创建<code>Student</code>实体类，包名为<code>xust.stu.demo.domain</code></p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/java/xust/stu/demo/domain/Student.java</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-6-1">  1</a></span>
<span class="normal"><a href="#__codelineno-6-2">  2</a></span>
<span class="normal"><a href="#__codelineno-6-3">  3</a></span>
<span class="normal"><a href="#__codelineno-6-4">  4</a></span>
<span class="normal"><a href="#__codelineno-6-5">  5</a></span>
<span class="normal"><a href="#__codelineno-6-6">  6</a></span>
<span class="normal"><a href="#__codelineno-6-7">  7</a></span>
<span class="normal"><a href="#__codelineno-6-8">  8</a></span>
<span class="normal"><a href="#__codelineno-6-9">  9</a></span>
<span class="normal"><a href="#__codelineno-6-10"> 10</a></span>
<span class="normal"><a href="#__codelineno-6-11"> 11</a></span>
<span class="normal"><a href="#__codelineno-6-12"> 12</a></span>
<span class="normal"><a href="#__codelineno-6-13"> 13</a></span>
<span class="normal"><a href="#__codelineno-6-14"> 14</a></span>
<span class="normal"><a href="#__codelineno-6-15"> 15</a></span>
<span class="normal"><a href="#__codelineno-6-16"> 16</a></span>
<span class="normal"><a href="#__codelineno-6-17"> 17</a></span>
<span class="normal"><a href="#__codelineno-6-18"> 18</a></span>
<span class="normal"><a href="#__codelineno-6-19"> 19</a></span>
<span class="normal"><a href="#__codelineno-6-20"> 20</a></span>
<span class="normal"><a href="#__codelineno-6-21"> 21</a></span>
<span class="normal"><a href="#__codelineno-6-22"> 22</a></span>
<span class="normal"><a href="#__codelineno-6-23"> 23</a></span>
<span class="normal"><a href="#__codelineno-6-24"> 24</a></span>
<span class="normal"><a href="#__codelineno-6-25"> 25</a></span>
<span class="normal"><a href="#__codelineno-6-26"> 26</a></span>
<span class="normal"><a href="#__codelineno-6-27"> 27</a></span>
<span class="normal"><a href="#__codelineno-6-28"> 28</a></span>
<span class="normal"><a href="#__codelineno-6-29"> 29</a></span>
<span class="normal"><a href="#__codelineno-6-30"> 30</a></span>
<span class="normal"><a href="#__codelineno-6-31"> 31</a></span>
<span class="normal"><a href="#__codelineno-6-32"> 32</a></span>
<span class="normal"><a href="#__codelineno-6-33"> 33</a></span>
<span class="normal"><a href="#__codelineno-6-34"> 34</a></span>
<span class="normal"><a href="#__codelineno-6-35"> 35</a></span>
<span class="normal"><a href="#__codelineno-6-36"> 36</a></span>
<span class="normal"><a href="#__codelineno-6-37"> 37</a></span>
<span class="normal"><a href="#__codelineno-6-38"> 38</a></span>
<span class="normal"><a href="#__codelineno-6-39"> 39</a></span>
<span class="normal"><a href="#__codelineno-6-40"> 40</a></span>
<span class="normal"><a href="#__codelineno-6-41"> 41</a></span>
<span class="normal"><a href="#__codelineno-6-42"> 42</a></span>
<span class="normal"><a href="#__codelineno-6-43"> 43</a></span>
<span class="normal"><a href="#__codelineno-6-44"> 44</a></span>
<span class="normal"><a href="#__codelineno-6-45"> 45</a></span>
<span class="normal"><a href="#__codelineno-6-46"> 46</a></span>
<span class="normal"><a href="#__codelineno-6-47"> 47</a></span>
<span class="normal"><a href="#__codelineno-6-48"> 48</a></span>
<span class="normal"><a href="#__codelineno-6-49"> 49</a></span>
<span class="normal"><a href="#__codelineno-6-50"> 50</a></span>
<span class="normal"><a href="#__codelineno-6-51"> 51</a></span>
<span class="normal"><a href="#__codelineno-6-52"> 52</a></span>
<span class="normal"><a href="#__codelineno-6-53"> 53</a></span>
<span class="normal"><a href="#__codelineno-6-54"> 54</a></span>
<span class="normal"><a href="#__codelineno-6-55"> 55</a></span>
<span class="normal"><a href="#__codelineno-6-56"> 56</a></span>
<span class="normal"><a href="#__codelineno-6-57"> 57</a></span>
<span class="normal"><a href="#__codelineno-6-58"> 58</a></span>
<span class="normal"><a href="#__codelineno-6-59"> 59</a></span>
<span class="normal"><a href="#__codelineno-6-60"> 60</a></span>
<span class="normal"><a href="#__codelineno-6-61"> 61</a></span>
<span class="normal"><a href="#__codelineno-6-62"> 62</a></span>
<span class="normal"><a href="#__codelineno-6-63"> 63</a></span>
<span class="normal"><a href="#__codelineno-6-64"> 64</a></span>
<span class="normal"><a href="#__codelineno-6-65"> 65</a></span>
<span class="normal"><a href="#__codelineno-6-66"> 66</a></span>
<span class="normal"><a href="#__codelineno-6-67"> 67</a></span>
<span class="normal"><a href="#__codelineno-6-68"> 68</a></span>
<span class="normal"><a href="#__codelineno-6-69"> 69</a></span>
<span class="normal"><a href="#__codelineno-6-70"> 70</a></span>
<span class="normal"><a href="#__codelineno-6-71"> 71</a></span>
<span class="normal"><a href="#__codelineno-6-72"> 72</a></span>
<span class="normal"><a href="#__codelineno-6-73"> 73</a></span>
<span class="normal"><a href="#__codelineno-6-74"> 74</a></span>
<span class="normal"><a href="#__codelineno-6-75"> 75</a></span>
<span class="normal"><a href="#__codelineno-6-76"> 76</a></span>
<span class="normal"><a href="#__codelineno-6-77"> 77</a></span>
<span class="normal"><a href="#__codelineno-6-78"> 78</a></span>
<span class="normal"><a href="#__codelineno-6-79"> 79</a></span>
<span class="normal"><a href="#__codelineno-6-80"> 80</a></span>
<span class="normal"><a href="#__codelineno-6-81"> 81</a></span>
<span class="normal"><a href="#__codelineno-6-82"> 82</a></span>
<span class="normal"><a href="#__codelineno-6-83"> 83</a></span>
<span class="normal"><a href="#__codelineno-6-84"> 84</a></span>
<span class="normal"><a href="#__codelineno-6-85"> 85</a></span>
<span class="normal"><a href="#__codelineno-6-86"> 86</a></span>
<span class="normal"><a href="#__codelineno-6-87"> 87</a></span>
<span class="normal"><a href="#__codelineno-6-88"> 88</a></span>
<span class="normal"><a href="#__codelineno-6-89"> 89</a></span>
<span class="normal"><a href="#__codelineno-6-90"> 90</a></span>
<span class="normal"><a href="#__codelineno-6-91"> 91</a></span>
<span class="normal"><a href="#__codelineno-6-92"> 92</a></span>
<span class="normal"><a href="#__codelineno-6-93"> 93</a></span>
<span class="normal"><a href="#__codelineno-6-94"> 94</a></span>
<span class="normal"><a href="#__codelineno-6-95"> 95</a></span>
<span class="normal"><a href="#__codelineno-6-96"> 96</a></span>
<span class="normal"><a href="#__codelineno-6-97"> 97</a></span>
<span class="normal"><a href="#__codelineno-6-98"> 98</a></span>
<span class="normal"><a href="#__codelineno-6-99"> 99</a></span>
<span class="normal"><a href="#__codelineno-6-100">100</a></span>
<span class="normal"><a href="#__codelineno-6-101">101</a></span>
<span class="normal"><a href="#__codelineno-6-102">102</a></span>
<span class="normal"><a href="#__codelineno-6-103">103</a></span>
<span class="normal"><a href="#__codelineno-6-104">104</a></span>
<span class="normal"><a href="#__codelineno-6-105">105</a></span>
<span class="normal"><a href="#__codelineno-6-106">106</a></span>
<span class="normal"><a href="#__codelineno-6-107">107</a></span>
<span class="normal"><a href="#__codelineno-6-108">108</a></span>
<span class="normal"><a href="#__codelineno-6-109">109</a></span>
<span class="normal"><a href="#__codelineno-6-110">110</a></span>
<span class="normal"><a href="#__codelineno-6-111">111</a></span>
<span class="normal"><a href="#__codelineno-6-112">112</a></span>
<span class="normal"><a href="#__codelineno-6-113">113</a></span>
<span class="normal"><a href="#__codelineno-6-114">114</a></span>
<span class="normal"><a href="#__codelineno-6-115">115</a></span>
<span class="normal"><a href="#__codelineno-6-116">116</a></span>
<span class="normal"><a href="#__codelineno-6-117">117</a></span>
<span class="normal"><a href="#__codelineno-6-118">118</a></span>
<span class="normal"><a href="#__codelineno-6-119">119</a></span>
<span class="normal"><a href="#__codelineno-6-120">120</a></span>
<span class="normal"><a href="#__codelineno-6-121">121</a></span>
<span class="normal"><a href="#__codelineno-6-122">122</a></span>
<span class="normal"><a href="#__codelineno-6-123">123</a></span>
<span class="normal"><a href="#__codelineno-6-124">124</a></span>
<span class="normal"><a href="#__codelineno-6-125">125</a></span>
<span class="normal"><a href="#__codelineno-6-126">126</a></span>
<span class="normal"><a href="#__codelineno-6-127">127</a></span>
<span class="normal"><a href="#__codelineno-6-128">128</a></span>
<span class="normal"><a href="#__codelineno-6-129">129</a></span>
<span class="normal"><a href="#__codelineno-6-130">130</a></span>
<span class="normal"><a href="#__codelineno-6-131">131</a></span>
<span class="normal"><a href="#__codelineno-6-132">132</a></span>
<span class="normal"><a href="#__codelineno-6-133">133</a></span>
<span class="normal"><a href="#__codelineno-6-134">134</a></span>
<span class="normal"><a href="#__codelineno-6-135">135</a></span>
<span class="normal"><a href="#__codelineno-6-136">136</a></span>
<span class="normal"><a href="#__codelineno-6-137">137</a></span>
<span class="normal"><a href="#__codelineno-6-138">138</a></span>
<span class="normal"><a href="#__codelineno-6-139">139</a></span>
<span class="normal"><a href="#__codelineno-6-140">140</a></span>
<span class="normal"><a href="#__codelineno-6-141">141</a></span>
<span class="normal"><a href="#__codelineno-6-142">142</a></span>
<span class="normal"><a href="#__codelineno-6-143">143</a></span>
<span class="normal"><a href="#__codelineno-6-144">144</a></span>
<span class="normal"><a href="#__codelineno-6-145">145</a></span>
<span class="normal"><a href="#__codelineno-6-146">146</a></span>
<span class="normal"><a href="#__codelineno-6-147">147</a></span>
<span class="normal"><a href="#__codelineno-6-148">148</a></span>
<span class="normal"><a href="#__codelineno-6-149">149</a></span>
<span class="normal"><a href="#__codelineno-6-150">150</a></span>
<span class="normal"><a href="#__codelineno-6-151">151</a></span>
<span class="normal"><a href="#__codelineno-6-152">152</a></span>
<span class="normal"><a href="#__codelineno-6-153">153</a></span>
<span class="normal"><a href="#__codelineno-6-154">154</a></span>
<span class="normal"><a href="#__codelineno-6-155">155</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1"></a><span class="cm">/*</span>
<a id="__codelineno-6-2" name="__codelineno-6-2"></a><span class="cm"> * File name : Student.java 2023-04-20</span>
<a id="__codelineno-6-3" name="__codelineno-6-3"></a><span class="cm"> * @generated May 28, 2023, 9:37:49 AM</span>
<a id="__codelineno-6-4" name="__codelineno-6-4"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-6-5" name="__codelineno-6-5"></a><span class="cm"> * Copyright 2023 XUST. All rights reserved.</span>
<a id="__codelineno-6-6" name="__codelineno-6-6"></a><span class="cm"> */</span>
<a id="__codelineno-6-7" name="__codelineno-6-7"></a><span class="n">package</span><span class="w"> </span><span class="n">xust</span><span class="p">.</span><span class="n">stu</span><span class="p">.</span><span class="n">demo</span><span class="p">.</span><span class="k">domain</span><span class="p">;</span>
<a id="__codelineno-6-8" name="__codelineno-6-8"></a>
<a id="__codelineno-6-9" name="__codelineno-6-9"></a><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="n">DecimalMax</span><span class="p">;</span>
<a id="__codelineno-6-10" name="__codelineno-6-10"></a><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="n">DecimalMin</span><span class="p">;</span>
<a id="__codelineno-6-11" name="__codelineno-6-11"></a><span class="o">//</span><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="n">Email</span><span class="p">;</span>
<a id="__codelineno-6-12" name="__codelineno-6-12"></a><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="k">Max</span><span class="p">;</span>
<a id="__codelineno-6-13" name="__codelineno-6-13"></a><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="k">Min</span><span class="p">;</span>
<a id="__codelineno-6-14" name="__codelineno-6-14"></a><span class="o">//</span><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="n">NotEmpty</span><span class="p">;</span>
<a id="__codelineno-6-15" name="__codelineno-6-15"></a><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="k">NotNull</span><span class="p">;</span>
<a id="__codelineno-6-16" name="__codelineno-6-16"></a><span class="n">import</span><span class="w"> </span><span class="n">javax</span><span class="p">.</span><span class="n">validation</span><span class="p">.</span><span class="k">constraints</span><span class="p">.</span><span class="k">Size</span><span class="p">;</span>
<a id="__codelineno-6-17" name="__codelineno-6-17"></a><span class="n">import</span><span class="w"> </span><span class="n">com</span><span class="p">.</span><span class="n">fasterxml</span><span class="p">.</span><span class="n">jackson</span><span class="p">.</span><span class="n">annotation</span><span class="p">.</span><span class="n">JsonFormat</span><span class="p">;</span>
<a id="__codelineno-6-18" name="__codelineno-6-18"></a><span class="n">import</span><span class="w"> </span><span class="n">com</span><span class="p">.</span><span class="n">fasterxml</span><span class="p">.</span><span class="n">jackson</span><span class="p">.</span><span class="n">core</span><span class="p">.</span><span class="n">JsonProcessingException</span><span class="p">;</span>
<a id="__codelineno-6-19" name="__codelineno-6-19"></a><span class="n">import</span><span class="w"> </span><span class="n">com</span><span class="p">.</span><span class="n">fasterxml</span><span class="p">.</span><span class="n">jackson</span><span class="p">.</span><span class="n">databind</span><span class="p">.</span><span class="n">ObjectMapper</span><span class="p">;</span>
<a id="__codelineno-6-20" name="__codelineno-6-20"></a>
<a id="__codelineno-6-21" name="__codelineno-6-21"></a>
<a id="__codelineno-6-22" name="__codelineno-6-22"></a><span class="cm">/**</span>
<a id="__codelineno-6-23" name="__codelineno-6-23"></a><span class="cm"> * Class Student</span>
<a id="__codelineno-6-24" name="__codelineno-6-24"></a><span class="cm"> * 学生表</span>
<a id="__codelineno-6-25" name="__codelineno-6-25"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-6-26" name="__codelineno-6-26"></a><span class="cm"> * @version 1.0, 2023-04-20</span>
<a id="__codelineno-6-27" name="__codelineno-6-27"></a><span class="cm"> */</span>
<a id="__codelineno-6-28" name="__codelineno-6-28"></a><span class="k">public</span><span class="w"> </span><span class="k">class</span><span class="w"> </span><span class="n">Student</span><span class="err">{</span>
<a id="__codelineno-6-29" name="__codelineno-6-29"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="k">final</span><span class="w"> </span><span class="n">long</span><span class="w"> </span><span class="n">serialVersionUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">-</span><span class="mi">8178158848305435288</span><span class="n">L</span><span class="p">;</span>
<a id="__codelineno-6-30" name="__codelineno-6-30"></a><span class="w">  </span><span class="k">public</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">ObjectMapper</span><span class="w"> </span><span class="n">objectMapper</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">ObjectMapper</span><span class="p">();</span>
<a id="__codelineno-6-31" name="__codelineno-6-31"></a>
<a id="__codelineno-6-32" name="__codelineno-6-32"></a>
<a id="__codelineno-6-33" name="__codelineno-6-33"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-6-34" name="__codelineno-6-34"></a><span class="cm">   * Id</span>
<a id="__codelineno-6-35" name="__codelineno-6-35"></a><span class="cm">   */</span>
<a id="__codelineno-6-36" name="__codelineno-6-36"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">id</span><span class="p">;</span>
<a id="__codelineno-6-37" name="__codelineno-6-37"></a>
<a id="__codelineno-6-38" name="__codelineno-6-38"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-6-39" name="__codelineno-6-39"></a><span class="cm">   * 学号</span>
<a id="__codelineno-6-40" name="__codelineno-6-40"></a><span class="cm">   */</span>
<a id="__codelineno-6-41" name="__codelineno-6-41"></a><span class="w">  </span><span class="o">@</span><span class="k">NotNull</span>
<a id="__codelineno-6-42" name="__codelineno-6-42"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="k">no</span><span class="p">;</span>
<a id="__codelineno-6-43" name="__codelineno-6-43"></a>
<a id="__codelineno-6-44" name="__codelineno-6-44"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-6-45" name="__codelineno-6-45"></a><span class="cm">   * 姓名</span>
<a id="__codelineno-6-46" name="__codelineno-6-46"></a><span class="cm">   */</span>
<a id="__codelineno-6-47" name="__codelineno-6-47"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">name</span><span class="p">;</span>
<a id="__codelineno-6-48" name="__codelineno-6-48"></a>
<a id="__codelineno-6-49" name="__codelineno-6-49"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-6-50" name="__codelineno-6-50"></a><span class="cm">   * 性别</span>
<a id="__codelineno-6-51" name="__codelineno-6-51"></a><span class="cm">   */</span>
<a id="__codelineno-6-52" name="__codelineno-6-52"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">gender</span><span class="p">;</span>
<a id="__codelineno-6-53" name="__codelineno-6-53"></a>
<a id="__codelineno-6-54" name="__codelineno-6-54"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-6-55" name="__codelineno-6-55"></a><span class="cm">   * 年龄</span>
<a id="__codelineno-6-56" name="__codelineno-6-56"></a><span class="cm">   */</span>
<a id="__codelineno-6-57" name="__codelineno-6-57"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="nb">Integer</span><span class="w"> </span><span class="n">age</span><span class="p">;</span>
<a id="__codelineno-6-58" name="__codelineno-6-58"></a>
<a id="__codelineno-6-59" name="__codelineno-6-59"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-6-60" name="__codelineno-6-60"></a><span class="cm">   * 所在系</span>
<a id="__codelineno-6-61" name="__codelineno-6-61"></a><span class="cm">   */</span>
<a id="__codelineno-6-62" name="__codelineno-6-62"></a><span class="w">  </span><span class="n">private</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">dept</span><span class="p">;</span>
<a id="__codelineno-6-63" name="__codelineno-6-63"></a>
<a id="__codelineno-6-64" name="__codelineno-6-64"></a>
<a id="__codelineno-6-65" name="__codelineno-6-65"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-66" name="__codelineno-6-66"></a><span class="cm">     * Id</span>
<a id="__codelineno-6-67" name="__codelineno-6-67"></a><span class="cm">     */</span>
<a id="__codelineno-6-68" name="__codelineno-6-68"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">getId</span><span class="p">()</span><span class="err">{</span>
<a id="__codelineno-6-69" name="__codelineno-6-69"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">id</span><span class="p">;</span>
<a id="__codelineno-6-70" name="__codelineno-6-70"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-71" name="__codelineno-6-71"></a>
<a id="__codelineno-6-72" name="__codelineno-6-72"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-73" name="__codelineno-6-73"></a><span class="cm">     * Id</span>
<a id="__codelineno-6-74" name="__codelineno-6-74"></a><span class="cm">     */</span>
<a id="__codelineno-6-75" name="__codelineno-6-75"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">void</span><span class="w"> </span><span class="n">setId</span><span class="p">(</span><span class="n">String</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="err">{</span>
<a id="__codelineno-6-76" name="__codelineno-6-76"></a><span class="w">        </span><span class="n">id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">newValue</span><span class="p">;</span>
<a id="__codelineno-6-77" name="__codelineno-6-77"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-78" name="__codelineno-6-78"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-79" name="__codelineno-6-79"></a><span class="cm">     * 学号</span>
<a id="__codelineno-6-80" name="__codelineno-6-80"></a><span class="cm">     */</span>
<a id="__codelineno-6-81" name="__codelineno-6-81"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">getNo</span><span class="p">()</span><span class="err">{</span>
<a id="__codelineno-6-82" name="__codelineno-6-82"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="k">no</span><span class="p">;</span>
<a id="__codelineno-6-83" name="__codelineno-6-83"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-84" name="__codelineno-6-84"></a>
<a id="__codelineno-6-85" name="__codelineno-6-85"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-86" name="__codelineno-6-86"></a><span class="cm">     * 学号</span>
<a id="__codelineno-6-87" name="__codelineno-6-87"></a><span class="cm">     */</span>
<a id="__codelineno-6-88" name="__codelineno-6-88"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">void</span><span class="w"> </span><span class="n">setNo</span><span class="p">(</span><span class="n">String</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="err">{</span>
<a id="__codelineno-6-89" name="__codelineno-6-89"></a><span class="w">        </span><span class="k">no</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">newValue</span><span class="p">;</span>
<a id="__codelineno-6-90" name="__codelineno-6-90"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-91" name="__codelineno-6-91"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-92" name="__codelineno-6-92"></a><span class="cm">     * 姓名</span>
<a id="__codelineno-6-93" name="__codelineno-6-93"></a><span class="cm">     */</span>
<a id="__codelineno-6-94" name="__codelineno-6-94"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">getName</span><span class="p">()</span><span class="err">{</span>
<a id="__codelineno-6-95" name="__codelineno-6-95"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">name</span><span class="p">;</span>
<a id="__codelineno-6-96" name="__codelineno-6-96"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-97" name="__codelineno-6-97"></a>
<a id="__codelineno-6-98" name="__codelineno-6-98"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-99" name="__codelineno-6-99"></a><span class="cm">     * 姓名</span>
<a id="__codelineno-6-100" name="__codelineno-6-100"></a><span class="cm">     */</span>
<a id="__codelineno-6-101" name="__codelineno-6-101"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">void</span><span class="w"> </span><span class="n">setName</span><span class="p">(</span><span class="n">String</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="err">{</span>
<a id="__codelineno-6-102" name="__codelineno-6-102"></a><span class="w">        </span><span class="n">name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">newValue</span><span class="p">;</span>
<a id="__codelineno-6-103" name="__codelineno-6-103"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-104" name="__codelineno-6-104"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-105" name="__codelineno-6-105"></a><span class="cm">     * 性别</span>
<a id="__codelineno-6-106" name="__codelineno-6-106"></a><span class="cm">     */</span>
<a id="__codelineno-6-107" name="__codelineno-6-107"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">getGender</span><span class="p">()</span><span class="err">{</span>
<a id="__codelineno-6-108" name="__codelineno-6-108"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">gender</span><span class="p">;</span>
<a id="__codelineno-6-109" name="__codelineno-6-109"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-110" name="__codelineno-6-110"></a>
<a id="__codelineno-6-111" name="__codelineno-6-111"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-112" name="__codelineno-6-112"></a><span class="cm">     * 性别</span>
<a id="__codelineno-6-113" name="__codelineno-6-113"></a><span class="cm">     */</span>
<a id="__codelineno-6-114" name="__codelineno-6-114"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">void</span><span class="w"> </span><span class="n">setGender</span><span class="p">(</span><span class="n">String</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="err">{</span>
<a id="__codelineno-6-115" name="__codelineno-6-115"></a><span class="w">        </span><span class="n">gender</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">newValue</span><span class="p">;</span>
<a id="__codelineno-6-116" name="__codelineno-6-116"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-117" name="__codelineno-6-117"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-118" name="__codelineno-6-118"></a><span class="cm">     * 年龄</span>
<a id="__codelineno-6-119" name="__codelineno-6-119"></a><span class="cm">     */</span>
<a id="__codelineno-6-120" name="__codelineno-6-120"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="nb">Integer</span><span class="w"> </span><span class="n">getAge</span><span class="p">()</span><span class="err">{</span>
<a id="__codelineno-6-121" name="__codelineno-6-121"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">age</span><span class="p">;</span>
<a id="__codelineno-6-122" name="__codelineno-6-122"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-123" name="__codelineno-6-123"></a>
<a id="__codelineno-6-124" name="__codelineno-6-124"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-125" name="__codelineno-6-125"></a><span class="cm">     * 年龄</span>
<a id="__codelineno-6-126" name="__codelineno-6-126"></a><span class="cm">     */</span>
<a id="__codelineno-6-127" name="__codelineno-6-127"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">void</span><span class="w"> </span><span class="n">setAge</span><span class="p">(</span><span class="nb">Integer</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="err">{</span>
<a id="__codelineno-6-128" name="__codelineno-6-128"></a><span class="w">        </span><span class="n">age</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">newValue</span><span class="p">;</span>
<a id="__codelineno-6-129" name="__codelineno-6-129"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-130" name="__codelineno-6-130"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-131" name="__codelineno-6-131"></a><span class="cm">     * 所在系</span>
<a id="__codelineno-6-132" name="__codelineno-6-132"></a><span class="cm">     */</span>
<a id="__codelineno-6-133" name="__codelineno-6-133"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">getDept</span><span class="p">()</span><span class="err">{</span>
<a id="__codelineno-6-134" name="__codelineno-6-134"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">dept</span><span class="p">;</span>
<a id="__codelineno-6-135" name="__codelineno-6-135"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-136" name="__codelineno-6-136"></a>
<a id="__codelineno-6-137" name="__codelineno-6-137"></a><span class="w">    </span><span class="cm">/**</span>
<a id="__codelineno-6-138" name="__codelineno-6-138"></a><span class="cm">     * 所在系</span>
<a id="__codelineno-6-139" name="__codelineno-6-139"></a><span class="cm">     */</span>
<a id="__codelineno-6-140" name="__codelineno-6-140"></a><span class="w">    </span><span class="k">public</span><span class="w"> </span><span class="n">void</span><span class="w"> </span><span class="n">setDept</span><span class="p">(</span><span class="n">String</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="err">{</span>
<a id="__codelineno-6-141" name="__codelineno-6-141"></a><span class="w">        </span><span class="n">dept</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">newValue</span><span class="p">;</span>
<a id="__codelineno-6-142" name="__codelineno-6-142"></a><span class="w">    </span><span class="err">}</span>
<a id="__codelineno-6-143" name="__codelineno-6-143"></a>
<a id="__codelineno-6-144" name="__codelineno-6-144"></a><span class="w">  </span><span class="o">@</span><span class="n">Override</span>
<a id="__codelineno-6-145" name="__codelineno-6-145"></a><span class="w">  </span><span class="k">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">toString</span><span class="p">()</span><span class="w"> </span><span class="err">{</span>
<a id="__codelineno-6-146" name="__codelineno-6-146"></a><span class="w">    </span><span class="n">String</span><span class="w"> </span><span class="n">res</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="ss">&quot;&quot;</span><span class="p">;</span>
<a id="__codelineno-6-147" name="__codelineno-6-147"></a>
<a id="__codelineno-6-148" name="__codelineno-6-148"></a><span class="w">    </span><span class="n">try</span><span class="w"> </span><span class="err">{</span>
<a id="__codelineno-6-149" name="__codelineno-6-149"></a><span class="w">      </span><span class="n">res</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">objectMapper</span><span class="p">.</span><span class="n">writeValueAsString</span><span class="p">(</span><span class="n">this</span><span class="p">);</span>
<a id="__codelineno-6-150" name="__codelineno-6-150"></a><span class="w">    </span><span class="err">}</span><span class="w"> </span><span class="n">catch</span><span class="w"> </span><span class="p">(</span><span class="k">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
<a id="__codelineno-6-151" name="__codelineno-6-151"></a><span class="w">    </span><span class="err">}</span><span class="w">  </span>
<a id="__codelineno-6-152" name="__codelineno-6-152"></a>
<a id="__codelineno-6-153" name="__codelineno-6-153"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">res</span><span class="p">;</span>
<a id="__codelineno-6-154" name="__codelineno-6-154"></a><span class="w">  </span><span class="err">}</span>
<a id="__codelineno-6-155" name="__codelineno-6-155"></a><span class="err">}</span>
</code></pre></div></td></tr></table></div>
</li>
</ol>
<h3 id="crud">实现CRUD操作</h3>
<ol>
<li>
<p>创建<code>StudentMapper</code>接口，定义CRUD操作方法，如下所示：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/java/xust/stu/demo/dao/StudentDao.java</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-7-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-7-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-7-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-7-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-7-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-7-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-7-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-7-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-7-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-7-10">10</a></span>
<span class="normal"><a href="#__codelineno-7-11">11</a></span>
<span class="normal"><a href="#__codelineno-7-12">12</a></span>
<span class="normal"><a href="#__codelineno-7-13">13</a></span>
<span class="normal"><a href="#__codelineno-7-14">14</a></span>
<span class="normal"><a href="#__codelineno-7-15">15</a></span>
<span class="normal"><a href="#__codelineno-7-16">16</a></span>
<span class="normal"><a href="#__codelineno-7-17">17</a></span>
<span class="normal"><a href="#__codelineno-7-18">18</a></span>
<span class="normal"><a href="#__codelineno-7-19">19</a></span>
<span class="normal"><a href="#__codelineno-7-20">20</a></span>
<span class="normal"><a href="#__codelineno-7-21">21</a></span>
<span class="normal"><a href="#__codelineno-7-22">22</a></span>
<span class="normal"><a href="#__codelineno-7-23">23</a></span>
<span class="normal"><a href="#__codelineno-7-24">24</a></span>
<span class="normal"><a href="#__codelineno-7-25">25</a></span>
<span class="normal"><a href="#__codelineno-7-26">26</a></span>
<span class="normal"><a href="#__codelineno-7-27">27</a></span>
<span class="normal"><a href="#__codelineno-7-28">28</a></span>
<span class="normal"><a href="#__codelineno-7-29">29</a></span>
<span class="normal"><a href="#__codelineno-7-30">30</a></span>
<span class="normal"><a href="#__codelineno-7-31">31</a></span>
<span class="normal"><a href="#__codelineno-7-32">32</a></span>
<span class="normal"><a href="#__codelineno-7-33">33</a></span>
<span class="normal"><a href="#__codelineno-7-34">34</a></span>
<span class="normal"><a href="#__codelineno-7-35">35</a></span>
<span class="normal"><a href="#__codelineno-7-36">36</a></span>
<span class="normal"><a href="#__codelineno-7-37">37</a></span>
<span class="normal"><a href="#__codelineno-7-38">38</a></span>
<span class="normal"><a href="#__codelineno-7-39">39</a></span>
<span class="normal"><a href="#__codelineno-7-40">40</a></span>
<span class="normal"><a href="#__codelineno-7-41">41</a></span>
<span class="normal"><a href="#__codelineno-7-42">42</a></span>
<span class="normal"><a href="#__codelineno-7-43">43</a></span>
<span class="normal"><a href="#__codelineno-7-44">44</a></span>
<span class="normal"><a href="#__codelineno-7-45">45</a></span>
<span class="normal"><a href="#__codelineno-7-46">46</a></span>
<span class="normal"><a href="#__codelineno-7-47">47</a></span>
<span class="normal"><a href="#__codelineno-7-48">48</a></span>
<span class="normal"><a href="#__codelineno-7-49">49</a></span>
<span class="normal"><a href="#__codelineno-7-50">50</a></span>
<span class="normal"><a href="#__codelineno-7-51">51</a></span>
<span class="normal"><a href="#__codelineno-7-52">52</a></span>
<span class="normal"><a href="#__codelineno-7-53">53</a></span>
<span class="normal"><a href="#__codelineno-7-54">54</a></span>
<span class="normal"><a href="#__codelineno-7-55">55</a></span>
<span class="normal"><a href="#__codelineno-7-56">56</a></span>
<span class="normal"><a href="#__codelineno-7-57">57</a></span>
<span class="normal"><a href="#__codelineno-7-58">58</a></span>
<span class="normal"><a href="#__codelineno-7-59">59</a></span>
<span class="normal"><a href="#__codelineno-7-60">60</a></span>
<span class="normal"><a href="#__codelineno-7-61">61</a></span>
<span class="normal"><a href="#__codelineno-7-62">62</a></span>
<span class="normal"><a href="#__codelineno-7-63">63</a></span>
<span class="normal"><a href="#__codelineno-7-64">64</a></span>
<span class="normal"><a href="#__codelineno-7-65">65</a></span>
<span class="normal"><a href="#__codelineno-7-66">66</a></span>
<span class="normal"><a href="#__codelineno-7-67">67</a></span>
<span class="normal"><a href="#__codelineno-7-68">68</a></span>
<span class="normal"><a href="#__codelineno-7-69">69</a></span>
<span class="normal"><a href="#__codelineno-7-70">70</a></span>
<span class="normal"><a href="#__codelineno-7-71">71</a></span>
<span class="normal"><a href="#__codelineno-7-72">72</a></span>
<span class="normal"><a href="#__codelineno-7-73">73</a></span>
<span class="normal"><a href="#__codelineno-7-74">74</a></span>
<span class="normal"><a href="#__codelineno-7-75">75</a></span>
<span class="normal"><a href="#__codelineno-7-76">76</a></span>
<span class="normal"><a href="#__codelineno-7-77">77</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1"></a><span class="cm">/*</span>
<a id="__codelineno-7-2" name="__codelineno-7-2"></a><span class="cm"> * File name : Student.java 2023-04-20</span>
<a id="__codelineno-7-3" name="__codelineno-7-3"></a><span class="cm"> * @generated May 28, 2023, 9:37:49 AM</span>
<a id="__codelineno-7-4" name="__codelineno-7-4"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-7-5" name="__codelineno-7-5"></a><span class="cm"> * Copyright 2023 XUST. All rights reserved.</span>
<a id="__codelineno-7-6" name="__codelineno-7-6"></a><span class="cm"> */</span>
<a id="__codelineno-7-7" name="__codelineno-7-7"></a><span class="kn">package</span><span class="w"> </span><span class="nn">xust.stu.demo.dao</span><span class="p">;</span>
<a id="__codelineno-7-8" name="__codelineno-7-8"></a>
<a id="__codelineno-7-9" name="__codelineno-7-9"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.ibatis.annotations.Mapper</span><span class="p">;</span>
<a id="__codelineno-7-10" name="__codelineno-7-10"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.ibatis.annotations.Param</span><span class="p">;</span>
<a id="__codelineno-7-11" name="__codelineno-7-11"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.Map</span><span class="p">;</span>
<a id="__codelineno-7-12" name="__codelineno-7-12"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.List</span><span class="p">;</span>
<a id="__codelineno-7-13" name="__codelineno-7-13"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.domain.Student</span><span class="p">;</span>
<a id="__codelineno-7-14" name="__codelineno-7-14"></a>
<a id="__codelineno-7-15" name="__codelineno-7-15"></a><span class="cm">/**</span>
<a id="__codelineno-7-16" name="__codelineno-7-16"></a><span class="cm"> * StudentDao</span>
<a id="__codelineno-7-17" name="__codelineno-7-17"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-7-18" name="__codelineno-7-18"></a><span class="cm"> * @version 1.0, 2023-04-20</span>
<a id="__codelineno-7-19" name="__codelineno-7-19"></a><span class="cm"> */</span>
<a id="__codelineno-7-20" name="__codelineno-7-20"></a><span class="nd">@Mapper</span>
<a id="__codelineno-7-21" name="__codelineno-7-21"></a><span class="kd">public</span><span class="w"> </span><span class="kd">interface</span> <span class="nc">StudentDao</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-7-22" name="__codelineno-7-22"></a>
<a id="__codelineno-7-23" name="__codelineno-7-23"></a><span class="w">  </span><span class="c1">///////////////////// Create</span>
<a id="__codelineno-7-24" name="__codelineno-7-24"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-25" name="__codelineno-7-25"></a><span class="cm">   * 创建对象</span>
<a id="__codelineno-7-26" name="__codelineno-7-26"></a><span class="cm">   * @param newValue 新对象</span>
<a id="__codelineno-7-27" name="__codelineno-7-27"></a><span class="cm">   * @return 影响行数，1为成功，0为失败</span>
<a id="__codelineno-7-28" name="__codelineno-7-28"></a><span class="cm">   */</span>
<a id="__codelineno-7-29" name="__codelineno-7-29"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">create</span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">newValue</span><span class="p">);</span>
<a id="__codelineno-7-30" name="__codelineno-7-30"></a>
<a id="__codelineno-7-31" name="__codelineno-7-31"></a><span class="w">  </span><span class="c1">///////////////////// Retrie</span>
<a id="__codelineno-7-32" name="__codelineno-7-32"></a>
<a id="__codelineno-7-33" name="__codelineno-7-33"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-34" name="__codelineno-7-34"></a><span class="cm">   * 获取对象数量</span>
<a id="__codelineno-7-35" name="__codelineno-7-35"></a><span class="cm">   * @param params 并参数</span>
<a id="__codelineno-7-36" name="__codelineno-7-36"></a><span class="cm">   * @return 非空新对象，非空Integer对象</span>
<a id="__codelineno-7-37" name="__codelineno-7-37"></a><span class="cm">   */</span>
<a id="__codelineno-7-38" name="__codelineno-7-38"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">size</span><span class="p">(</span><span class="nd">@Param</span><span class="p">(</span><span class="s">&quot;params&quot;</span><span class="p">)</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">);</span>
<a id="__codelineno-7-39" name="__codelineno-7-39"></a>
<a id="__codelineno-7-40" name="__codelineno-7-40"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-41" name="__codelineno-7-41"></a><span class="cm">   * 获取对象分页</span>
<a id="__codelineno-7-42" name="__codelineno-7-42"></a><span class="cm">   * @param params 并参数</span>
<a id="__codelineno-7-43" name="__codelineno-7-43"></a><span class="cm">   * @return 非空对象列表</span>
<a id="__codelineno-7-44" name="__codelineno-7-44"></a><span class="cm">   */</span>
<a id="__codelineno-7-45" name="__codelineno-7-45"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">getPage</span><span class="p">(</span><span class="nd">@Param</span><span class="p">(</span><span class="s">&quot;params&quot;</span><span class="p">)</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">,</span><span class="w"> </span><span class="nd">@Param</span><span class="p">(</span><span class="s">&quot;pageNum&quot;</span><span class="p">)</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">pageNum</span><span class="p">,</span><span class="w"> </span><span class="nd">@Param</span><span class="p">(</span><span class="s">&quot;pageSize&quot;</span><span class="p">)</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">pageSize</span><span class="p">);</span>
<a id="__codelineno-7-46" name="__codelineno-7-46"></a>
<a id="__codelineno-7-47" name="__codelineno-7-47"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-48" name="__codelineno-7-48"></a><span class="cm">   * 获取对象列表</span>
<a id="__codelineno-7-49" name="__codelineno-7-49"></a><span class="cm">   * @param items id列表</span>
<a id="__codelineno-7-50" name="__codelineno-7-50"></a><span class="cm">   * @return 非空对象列表</span>
<a id="__codelineno-7-51" name="__codelineno-7-51"></a><span class="cm">   */</span>
<a id="__codelineno-7-52" name="__codelineno-7-52"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">getItems</span><span class="p">(</span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="w"> </span><span class="n">items</span><span class="p">);</span>
<a id="__codelineno-7-53" name="__codelineno-7-53"></a>
<a id="__codelineno-7-54" name="__codelineno-7-54"></a><span class="w">  </span><span class="c1">///////////////////// Update</span>
<a id="__codelineno-7-55" name="__codelineno-7-55"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-56" name="__codelineno-7-56"></a><span class="cm">   * 更新对象</span>
<a id="__codelineno-7-57" name="__codelineno-7-57"></a><span class="cm">   * @param newValue 新值</span>
<a id="__codelineno-7-58" name="__codelineno-7-58"></a><span class="cm">   * @return 非空Integer对象</span>
<a id="__codelineno-7-59" name="__codelineno-7-59"></a><span class="cm">   */</span>
<a id="__codelineno-7-60" name="__codelineno-7-60"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">update</span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">newValue</span><span class="p">);</span>
<a id="__codelineno-7-61" name="__codelineno-7-61"></a>
<a id="__codelineno-7-62" name="__codelineno-7-62"></a><span class="w">  </span><span class="c1">///////////////////// Delete</span>
<a id="__codelineno-7-63" name="__codelineno-7-63"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-64" name="__codelineno-7-64"></a><span class="cm">   * 删除对象</span>
<a id="__codelineno-7-65" name="__codelineno-7-65"></a><span class="cm">   * @param ids id列表</span>
<a id="__codelineno-7-66" name="__codelineno-7-66"></a><span class="cm">   * @return 非空Integer对象</span>
<a id="__codelineno-7-67" name="__codelineno-7-67"></a><span class="cm">   */</span>
<a id="__codelineno-7-68" name="__codelineno-7-68"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">deleteItems</span><span class="p">(</span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="w"> </span><span class="n">ids</span><span class="p">);</span>
<a id="__codelineno-7-69" name="__codelineno-7-69"></a>
<a id="__codelineno-7-70" name="__codelineno-7-70"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-7-71" name="__codelineno-7-71"></a><span class="cm">   * 删除对象</span>
<a id="__codelineno-7-72" name="__codelineno-7-72"></a><span class="cm">   * @return 非空Integer对象</span>
<a id="__codelineno-7-73" name="__codelineno-7-73"></a><span class="cm">   */</span>
<a id="__codelineno-7-74" name="__codelineno-7-74"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">deleteAll</span><span class="p">();</span>
<a id="__codelineno-7-75" name="__codelineno-7-75"></a>
<a id="__codelineno-7-76" name="__codelineno-7-76"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="nf">delete</span><span class="p">(</span><span class="nd">@Param</span><span class="p">(</span><span class="s">&quot;params&quot;</span><span class="p">)</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">);</span>
<a id="__codelineno-7-77" name="__codelineno-7-77"></a><span class="p">}</span>
</code></pre></div></td></tr></table></div>
</li>
<li>
<p>创建<code>StudentMapper.xml</code>文件，实现CRUD操作，如下所示：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/resources/mapper/DEMO_StudentDao.xml</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-8-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-8-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-8-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-8-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-8-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-8-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-8-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-8-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-8-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-8-10">10</a></span>
<span class="normal"><a href="#__codelineno-8-11">11</a></span>
<span class="normal"><a href="#__codelineno-8-12">12</a></span>
<span class="normal"><a href="#__codelineno-8-13">13</a></span>
<span class="normal"><a href="#__codelineno-8-14">14</a></span>
<span class="normal"><a href="#__codelineno-8-15">15</a></span>
<span class="normal"><a href="#__codelineno-8-16">16</a></span>
<span class="normal"><a href="#__codelineno-8-17">17</a></span>
<span class="normal"><a href="#__codelineno-8-18">18</a></span>
<span class="normal"><a href="#__codelineno-8-19">19</a></span>
<span class="normal"><a href="#__codelineno-8-20">20</a></span>
<span class="normal"><a href="#__codelineno-8-21">21</a></span>
<span class="normal"><a href="#__codelineno-8-22">22</a></span>
<span class="normal"><a href="#__codelineno-8-23">23</a></span>
<span class="normal"><a href="#__codelineno-8-24">24</a></span>
<span class="normal"><a href="#__codelineno-8-25">25</a></span>
<span class="normal"><a href="#__codelineno-8-26">26</a></span>
<span class="normal"><a href="#__codelineno-8-27">27</a></span>
<span class="normal"><a href="#__codelineno-8-28">28</a></span>
<span class="normal"><a href="#__codelineno-8-29">29</a></span>
<span class="normal"><a href="#__codelineno-8-30">30</a></span>
<span class="normal"><a href="#__codelineno-8-31">31</a></span>
<span class="normal"><a href="#__codelineno-8-32">32</a></span>
<span class="normal"><a href="#__codelineno-8-33">33</a></span>
<span class="normal"><a href="#__codelineno-8-34">34</a></span>
<span class="normal"><a href="#__codelineno-8-35">35</a></span>
<span class="normal"><a href="#__codelineno-8-36">36</a></span>
<span class="normal"><a href="#__codelineno-8-37">37</a></span>
<span class="normal"><a href="#__codelineno-8-38">38</a></span>
<span class="normal"><a href="#__codelineno-8-39">39</a></span>
<span class="normal"><a href="#__codelineno-8-40">40</a></span>
<span class="normal"><a href="#__codelineno-8-41">41</a></span>
<span class="normal"><a href="#__codelineno-8-42">42</a></span>
<span class="normal"><a href="#__codelineno-8-43">43</a></span>
<span class="normal"><a href="#__codelineno-8-44">44</a></span>
<span class="normal"><a href="#__codelineno-8-45">45</a></span>
<span class="normal"><a href="#__codelineno-8-46">46</a></span>
<span class="normal"><a href="#__codelineno-8-47">47</a></span>
<span class="normal"><a href="#__codelineno-8-48">48</a></span>
<span class="normal"><a href="#__codelineno-8-49">49</a></span>
<span class="normal"><a href="#__codelineno-8-50">50</a></span>
<span class="normal"><a href="#__codelineno-8-51">51</a></span>
<span class="normal"><a href="#__codelineno-8-52">52</a></span>
<span class="normal"><a href="#__codelineno-8-53">53</a></span>
<span class="normal"><a href="#__codelineno-8-54">54</a></span>
<span class="normal"><a href="#__codelineno-8-55">55</a></span>
<span class="normal"><a href="#__codelineno-8-56">56</a></span>
<span class="normal"><a href="#__codelineno-8-57">57</a></span>
<span class="normal"><a href="#__codelineno-8-58">58</a></span>
<span class="normal"><a href="#__codelineno-8-59">59</a></span>
<span class="normal"><a href="#__codelineno-8-60">60</a></span>
<span class="normal"><a href="#__codelineno-8-61">61</a></span>
<span class="normal"><a href="#__codelineno-8-62">62</a></span>
<span class="normal"><a href="#__codelineno-8-63">63</a></span>
<span class="normal"><a href="#__codelineno-8-64">64</a></span>
<span class="normal"><a href="#__codelineno-8-65">65</a></span>
<span class="normal"><a href="#__codelineno-8-66">66</a></span>
<span class="normal"><a href="#__codelineno-8-67">67</a></span>
<span class="normal"><a href="#__codelineno-8-68">68</a></span>
<span class="normal"><a href="#__codelineno-8-69">69</a></span>
<span class="normal"><a href="#__codelineno-8-70">70</a></span>
<span class="normal"><a href="#__codelineno-8-71">71</a></span>
<span class="normal"><a href="#__codelineno-8-72">72</a></span>
<span class="normal"><a href="#__codelineno-8-73">73</a></span>
<span class="normal"><a href="#__codelineno-8-74">74</a></span>
<span class="normal"><a href="#__codelineno-8-75">75</a></span>
<span class="normal"><a href="#__codelineno-8-76">76</a></span>
<span class="normal"><a href="#__codelineno-8-77">77</a></span>
<span class="normal"><a href="#__codelineno-8-78">78</a></span>
<span class="normal"><a href="#__codelineno-8-79">79</a></span>
<span class="normal"><a href="#__codelineno-8-80">80</a></span>
<span class="normal"><a href="#__codelineno-8-81">81</a></span>
<span class="normal"><a href="#__codelineno-8-82">82</a></span>
<span class="normal"><a href="#__codelineno-8-83">83</a></span>
<span class="normal"><a href="#__codelineno-8-84">84</a></span>
<span class="normal"><a href="#__codelineno-8-85">85</a></span>
<span class="normal"><a href="#__codelineno-8-86">86</a></span>
<span class="normal"><a href="#__codelineno-8-87">87</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1"></a><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;</span>
<a id="__codelineno-8-2" name="__codelineno-8-2"></a><span class="cp">&lt;!DOCTYPE mapper PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; &quot;http://mybatis.org/dtd/mybatis-3-mapper.dtd&quot; &gt;</span>
<a id="__codelineno-8-3" name="__codelineno-8-3"></a>
<a id="__codelineno-8-4" name="__codelineno-8-4"></a><span class="nt">&lt;mapper</span><span class="w"> </span><span class="na">namespace=</span><span class="s">&quot;xust.stu.demo.dao.StudentDao&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-5" name="__codelineno-8-5"></a>
<a id="__codelineno-8-6" name="__codelineno-8-6"></a><span class="w">  </span><span class="nt">&lt;resultMap</span><span class="w"> </span><span class="na">type=</span><span class="s">&quot;xust.stu.demo.domain.Student&quot;</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;studentResult&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-7" name="__codelineno-8-7"></a><span class="w">    </span><span class="nt">&lt;result</span><span class="w"> </span><span class="na">property=</span><span class="s">&quot;id&quot;</span><span class="w"> </span><span class="na">column=</span><span class="s">&quot;ID&quot;</span><span class="nt">&gt;&lt;/result&gt;</span>
<a id="__codelineno-8-8" name="__codelineno-8-8"></a><span class="w">    </span><span class="nt">&lt;result</span><span class="w"> </span><span class="na">property=</span><span class="s">&quot;no&quot;</span><span class="w"> </span><span class="na">column=</span><span class="s">&quot;NO&quot;</span><span class="nt">&gt;&lt;/result&gt;</span>
<a id="__codelineno-8-9" name="__codelineno-8-9"></a><span class="w">    </span><span class="nt">&lt;result</span><span class="w"> </span><span class="na">property=</span><span class="s">&quot;name&quot;</span><span class="w"> </span><span class="na">column=</span><span class="s">&quot;NAME&quot;</span><span class="nt">&gt;&lt;/result&gt;</span>
<a id="__codelineno-8-10" name="__codelineno-8-10"></a><span class="w">    </span><span class="nt">&lt;result</span><span class="w"> </span><span class="na">property=</span><span class="s">&quot;gender&quot;</span><span class="w"> </span><span class="na">column=</span><span class="s">&quot;GENDER&quot;</span><span class="nt">&gt;&lt;/result&gt;</span>
<a id="__codelineno-8-11" name="__codelineno-8-11"></a><span class="w">    </span><span class="nt">&lt;result</span><span class="w"> </span><span class="na">property=</span><span class="s">&quot;age&quot;</span><span class="w"> </span><span class="na">column=</span><span class="s">&quot;AGE&quot;</span><span class="nt">&gt;&lt;/result&gt;</span>
<a id="__codelineno-8-12" name="__codelineno-8-12"></a><span class="w">    </span><span class="nt">&lt;result</span><span class="w"> </span><span class="na">property=</span><span class="s">&quot;dept&quot;</span><span class="w"> </span><span class="na">column=</span><span class="s">&quot;DEPT&quot;</span><span class="nt">&gt;&lt;/result&gt;</span>
<a id="__codelineno-8-13" name="__codelineno-8-13"></a><span class="w">  </span><span class="nt">&lt;/resultMap&gt;</span>
<a id="__codelineno-8-14" name="__codelineno-8-14"></a>
<a id="__codelineno-8-15" name="__codelineno-8-15"></a><span class="w">  </span><span class="cm">&lt;!-- Create --&gt;</span>
<a id="__codelineno-8-16" name="__codelineno-8-16"></a><span class="w">  </span><span class="nt">&lt;insert</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;create&quot;</span><span class="w"> </span><span class="na">parameterType=</span><span class="s">&quot;xust.stu.demo.domain.Student&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-17" name="__codelineno-8-17"></a><span class="w">    </span><span class="cp">&lt;![CDATA[insert into Student(Id,no,name,gender,age,dept) </span>
<a id="__codelineno-8-18" name="__codelineno-8-18"></a><span class="cp">    values(#{id},#{no},#{name},#{gender},#{age},#{dept})]]&gt;</span>
<a id="__codelineno-8-19" name="__codelineno-8-19"></a><span class="w">  </span><span class="nt">&lt;/insert&gt;</span>
<a id="__codelineno-8-20" name="__codelineno-8-20"></a>
<a id="__codelineno-8-21" name="__codelineno-8-21"></a><span class="w">  </span><span class="cm">&lt;!-- Retriev data --&gt;</span>
<a id="__codelineno-8-22" name="__codelineno-8-22"></a><span class="w">  </span><span class="cm">&lt;!-- Retrieve data by id --&gt;</span>
<a id="__codelineno-8-23" name="__codelineno-8-23"></a><span class="w">  </span><span class="nt">&lt;select</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;size&quot;</span><span class="w"> </span><span class="na">resultType=</span><span class="s">&quot;int&quot;</span><span class="w"> </span><span class="na">parameterType=</span><span class="s">&quot;map&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-24" name="__codelineno-8-24"></a><span class="w">    </span><span class="cp">&lt;![CDATA[select count(*) from Student]]&gt;</span>
<a id="__codelineno-8-25" name="__codelineno-8-25"></a><span class="w">    </span><span class="nt">&lt;where&gt;</span>
<a id="__codelineno-8-26" name="__codelineno-8-26"></a><span class="w">      </span>1=1
<a id="__codelineno-8-27" name="__codelineno-8-27"></a><span class="w">      </span><span class="nt">&lt;if</span><span class="w"> </span><span class="na">test=</span><span class="s">&quot;params.id != null and params.id != &#39;&#39;&quot;</span><span class="nt">&gt;</span>and<span class="w"> </span>Id<span class="w"> </span>=<span class="w"> </span>#{params.id}<span class="nt">&lt;/if&gt;</span>
<a id="__codelineno-8-28" name="__codelineno-8-28"></a><span class="w">      </span><span class="nt">&lt;if</span><span class="w"> </span><span class="na">test=</span><span class="s">&quot;params.ids != null and params.ids.size &gt; 0&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-29" name="__codelineno-8-29"></a><span class="w">        </span>and<span class="w"> </span>id<span class="w"> </span>in<span class="w"> </span>
<a id="__codelineno-8-30" name="__codelineno-8-30"></a><span class="w">        </span><span class="nt">&lt;foreach</span><span class="w"> </span><span class="na">item=</span><span class="s">&quot;item&quot;</span><span class="w"> </span><span class="na">index=</span><span class="s">&quot;index&quot;</span><span class="w"> </span><span class="na">collection=</span><span class="s">&quot;params.ids&quot;</span><span class="w"> </span><span class="na">open=</span><span class="s">&quot;(&quot;</span><span class="w"> </span><span class="na">separator=</span><span class="s">&quot;,&quot;</span><span class="w"> </span><span class="na">close=</span><span class="s">&quot;)&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-31" name="__codelineno-8-31"></a><span class="w">        </span>#{item}
<a id="__codelineno-8-32" name="__codelineno-8-32"></a><span class="w">        </span><span class="nt">&lt;/foreach&gt;</span>
<a id="__codelineno-8-33" name="__codelineno-8-33"></a><span class="w">      </span><span class="nt">&lt;/if&gt;</span>
<a id="__codelineno-8-34" name="__codelineno-8-34"></a><span class="w">    </span><span class="nt">&lt;/where&gt;</span>
<a id="__codelineno-8-35" name="__codelineno-8-35"></a><span class="w">  </span><span class="nt">&lt;/select&gt;</span>
<a id="__codelineno-8-36" name="__codelineno-8-36"></a>
<a id="__codelineno-8-37" name="__codelineno-8-37"></a><span class="w">  </span><span class="cm">&lt;!-- Retrieve data by page--&gt;</span>
<a id="__codelineno-8-38" name="__codelineno-8-38"></a><span class="w">  </span><span class="nt">&lt;select</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;getPage&quot;</span><span class="w"> </span><span class="na">resultMap=</span><span class="s">&quot;studentResult&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-39" name="__codelineno-8-39"></a><span class="w">    </span><span class="cp">&lt;![CDATA[select Id,no,name,gender,age,dept from Student]]&gt;</span>
<a id="__codelineno-8-40" name="__codelineno-8-40"></a><span class="w">    </span><span class="nt">&lt;where&gt;</span>
<a id="__codelineno-8-41" name="__codelineno-8-41"></a><span class="w">      </span>1=1
<a id="__codelineno-8-42" name="__codelineno-8-42"></a><span class="w">      </span><span class="nt">&lt;if</span><span class="w"> </span><span class="na">test=</span><span class="s">&quot;params.id != null and params.id != &#39;&#39;&quot;</span><span class="nt">&gt;</span>and<span class="w"> </span>Id<span class="w"> </span>=<span class="w"> </span>#{params.id}<span class="nt">&lt;/if&gt;</span>
<a id="__codelineno-8-43" name="__codelineno-8-43"></a><span class="w">      </span><span class="nt">&lt;if</span><span class="w"> </span><span class="na">test=</span><span class="s">&quot;params.ids != null and params.ids.size &gt; 0&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-44" name="__codelineno-8-44"></a><span class="w">        </span>and<span class="w"> </span>id<span class="w"> </span>in<span class="w"> </span>
<a id="__codelineno-8-45" name="__codelineno-8-45"></a><span class="w">        </span><span class="nt">&lt;foreach</span><span class="w"> </span><span class="na">item=</span><span class="s">&quot;item&quot;</span><span class="w"> </span><span class="na">index=</span><span class="s">&quot;index&quot;</span><span class="w"> </span><span class="na">collection=</span><span class="s">&quot;params.ids&quot;</span><span class="w"> </span><span class="na">open=</span><span class="s">&quot;(&quot;</span><span class="w"> </span><span class="na">separator=</span><span class="s">&quot;,&quot;</span><span class="w"> </span><span class="na">close=</span><span class="s">&quot;)&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-46" name="__codelineno-8-46"></a><span class="w">        </span>#{item}
<a id="__codelineno-8-47" name="__codelineno-8-47"></a><span class="w">        </span><span class="nt">&lt;/foreach&gt;</span>
<a id="__codelineno-8-48" name="__codelineno-8-48"></a><span class="w">      </span><span class="nt">&lt;/if&gt;</span>
<a id="__codelineno-8-49" name="__codelineno-8-49"></a><span class="w">    </span><span class="nt">&lt;/where&gt;</span>
<a id="__codelineno-8-50" name="__codelineno-8-50"></a><span class="w">    </span>order<span class="w"> </span>by<span class="w"> </span>id<span class="w"> </span>desc
<a id="__codelineno-8-51" name="__codelineno-8-51"></a><span class="w">  </span><span class="nt">&lt;/select&gt;</span>
<a id="__codelineno-8-52" name="__codelineno-8-52"></a>
<a id="__codelineno-8-53" name="__codelineno-8-53"></a><span class="w">    </span><span class="cm">&lt;!-- Retrieve data by page--&gt;</span>
<a id="__codelineno-8-54" name="__codelineno-8-54"></a><span class="w">  </span><span class="nt">&lt;select</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;getItems&quot;</span><span class="w"> </span><span class="na">resultMap=</span><span class="s">&quot;studentResult&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-55" name="__codelineno-8-55"></a><span class="w">    </span><span class="cp">&lt;![CDATA[select Id,no,name,gender,age,dept from Student where Id in ]]&gt;</span>
<a id="__codelineno-8-56" name="__codelineno-8-56"></a><span class="w">    </span><span class="nt">&lt;foreach</span><span class="w"> </span><span class="na">item=</span><span class="s">&quot;item&quot;</span><span class="w"> </span><span class="na">index=</span><span class="s">&quot;index&quot;</span><span class="w"> </span><span class="na">collection=</span><span class="s">&quot;list&quot;</span><span class="w"> </span><span class="na">open=</span><span class="s">&quot;(&quot;</span><span class="w"> </span><span class="na">separator=</span><span class="s">&quot;,&quot;</span><span class="w"> </span><span class="na">close=</span><span class="s">&quot;)&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-57" name="__codelineno-8-57"></a><span class="w">      </span>#{item}
<a id="__codelineno-8-58" name="__codelineno-8-58"></a><span class="w">    </span><span class="nt">&lt;/foreach&gt;</span>
<a id="__codelineno-8-59" name="__codelineno-8-59"></a><span class="w">    </span>order<span class="w"> </span>by<span class="w"> </span>id<span class="w"> </span>desc
<a id="__codelineno-8-60" name="__codelineno-8-60"></a><span class="w">  </span><span class="nt">&lt;/select&gt;</span>
<a id="__codelineno-8-61" name="__codelineno-8-61"></a>
<a id="__codelineno-8-62" name="__codelineno-8-62"></a><span class="w">  </span><span class="cm">&lt;!-- Update according to id --&gt;</span>
<a id="__codelineno-8-63" name="__codelineno-8-63"></a><span class="w">  </span><span class="nt">&lt;update</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;update&quot;</span><span class="w"> </span><span class="na">parameterType=</span><span class="s">&quot;xust.stu.demo.domain.Student&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-64" name="__codelineno-8-64"></a><span class="w">    </span><span class="cp">&lt;![CDATA[update Student set no=#{no},name=#{name},gender=#{gender},age=#{age},dept=#{dept} where Id = #{id}]]&gt;</span>
<a id="__codelineno-8-65" name="__codelineno-8-65"></a><span class="w">  </span><span class="nt">&lt;/update&gt;</span>
<a id="__codelineno-8-66" name="__codelineno-8-66"></a>
<a id="__codelineno-8-67" name="__codelineno-8-67"></a><span class="w">  </span><span class="cm">&lt;!-- Delete --&gt;</span>
<a id="__codelineno-8-68" name="__codelineno-8-68"></a><span class="w">  </span><span class="nt">&lt;delete</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;deleteItems&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-69" name="__codelineno-8-69"></a><span class="w">    </span><span class="cp">&lt;![CDATA[delete from Student where Id in]]&gt;</span>
<a id="__codelineno-8-70" name="__codelineno-8-70"></a><span class="w">    </span><span class="nt">&lt;foreach</span><span class="w"> </span><span class="na">item=</span><span class="s">&quot;item&quot;</span><span class="w"> </span><span class="na">index=</span><span class="s">&quot;index&quot;</span><span class="w"> </span><span class="na">collection=</span><span class="s">&quot;list&quot;</span><span class="w"> </span><span class="na">open=</span><span class="s">&quot;(&quot;</span><span class="w"> </span><span class="na">separator=</span><span class="s">&quot;,&quot;</span><span class="w"> </span><span class="na">close=</span><span class="s">&quot;)&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-71" name="__codelineno-8-71"></a><span class="w">      </span>#{item}
<a id="__codelineno-8-72" name="__codelineno-8-72"></a><span class="w">    </span><span class="nt">&lt;/foreach&gt;</span>
<a id="__codelineno-8-73" name="__codelineno-8-73"></a><span class="w">  </span><span class="nt">&lt;/delete&gt;</span>
<a id="__codelineno-8-74" name="__codelineno-8-74"></a>
<a id="__codelineno-8-75" name="__codelineno-8-75"></a><span class="w">  </span><span class="nt">&lt;delete</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;deleteAll&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-76" name="__codelineno-8-76"></a><span class="w">    </span><span class="cp">&lt;![CDATA[delete from Student]]&gt;</span>
<a id="__codelineno-8-77" name="__codelineno-8-77"></a><span class="w">  </span><span class="nt">&lt;/delete&gt;</span>
<a id="__codelineno-8-78" name="__codelineno-8-78"></a>
<a id="__codelineno-8-79" name="__codelineno-8-79"></a><span class="w">  </span><span class="nt">&lt;delete</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;delete&quot;</span><span class="nt">&gt;</span>
<a id="__codelineno-8-80" name="__codelineno-8-80"></a><span class="w">    </span><span class="cp">&lt;![CDATA[delete from Student]]&gt;</span>
<a id="__codelineno-8-81" name="__codelineno-8-81"></a><span class="w">    </span><span class="nt">&lt;where&gt;</span>
<a id="__codelineno-8-82" name="__codelineno-8-82"></a><span class="w">      </span><span class="nt">&lt;if</span><span class="w"> </span><span class="na">test=</span><span class="s">&quot;params.id != null&quot;</span><span class="nt">&gt;</span>and<span class="w"> </span>id<span class="w"> </span>=<span class="w"> </span>#{params.id}<span class="nt">&lt;/if&gt;</span>
<a id="__codelineno-8-83" name="__codelineno-8-83"></a><span class="w">      </span><span class="nt">&lt;if</span><span class="w"> </span><span class="na">test=</span><span class="s">&quot;params.id == null&quot;</span><span class="nt">&gt;</span>and<span class="w"> </span>id<span class="w"> </span>=<span class="w"> </span>&#39;999999&#39;<span class="nt">&lt;/if&gt;</span>
<a id="__codelineno-8-84" name="__codelineno-8-84"></a><span class="w">    </span><span class="nt">&lt;/where&gt;</span>
<a id="__codelineno-8-85" name="__codelineno-8-85"></a><span class="w">  </span><span class="nt">&lt;/delete&gt;</span>
<a id="__codelineno-8-86" name="__codelineno-8-86"></a>
<a id="__codelineno-8-87" name="__codelineno-8-87"></a><span class="nt">&lt;/mapper&gt;</span>
</code></pre></div></td></tr></table></div>
</li>
<li>
<p>创建<code>StudentService</code>接口和<code>StudentServiceImpl</code>实现类，实现CRUD操作，如下所示：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/java/xust/stu/demo/service/StudentService.java</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-9-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-9-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-9-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-9-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-9-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-9-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-9-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-9-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-9-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-9-10">10</a></span>
<span class="normal"><a href="#__codelineno-9-11">11</a></span>
<span class="normal"><a href="#__codelineno-9-12">12</a></span>
<span class="normal"><a href="#__codelineno-9-13">13</a></span>
<span class="normal"><a href="#__codelineno-9-14">14</a></span>
<span class="normal"><a href="#__codelineno-9-15">15</a></span>
<span class="normal"><a href="#__codelineno-9-16">16</a></span>
<span class="normal"><a href="#__codelineno-9-17">17</a></span>
<span class="normal"><a href="#__codelineno-9-18">18</a></span>
<span class="normal"><a href="#__codelineno-9-19">19</a></span>
<span class="normal"><a href="#__codelineno-9-20">20</a></span>
<span class="normal"><a href="#__codelineno-9-21">21</a></span>
<span class="normal"><a href="#__codelineno-9-22">22</a></span>
<span class="normal"><a href="#__codelineno-9-23">23</a></span>
<span class="normal"><a href="#__codelineno-9-24">24</a></span>
<span class="normal"><a href="#__codelineno-9-25">25</a></span>
<span class="normal"><a href="#__codelineno-9-26">26</a></span>
<span class="normal"><a href="#__codelineno-9-27">27</a></span>
<span class="normal"><a href="#__codelineno-9-28">28</a></span>
<span class="normal"><a href="#__codelineno-9-29">29</a></span>
<span class="normal"><a href="#__codelineno-9-30">30</a></span>
<span class="normal"><a href="#__codelineno-9-31">31</a></span>
<span class="normal"><a href="#__codelineno-9-32">32</a></span>
<span class="normal"><a href="#__codelineno-9-33">33</a></span>
<span class="normal"><a href="#__codelineno-9-34">34</a></span>
<span class="normal"><a href="#__codelineno-9-35">35</a></span>
<span class="normal"><a href="#__codelineno-9-36">36</a></span>
<span class="normal"><a href="#__codelineno-9-37">37</a></span>
<span class="normal"><a href="#__codelineno-9-38">38</a></span>
<span class="normal"><a href="#__codelineno-9-39">39</a></span>
<span class="normal"><a href="#__codelineno-9-40">40</a></span>
<span class="normal"><a href="#__codelineno-9-41">41</a></span>
<span class="normal"><a href="#__codelineno-9-42">42</a></span>
<span class="normal"><a href="#__codelineno-9-43">43</a></span>
<span class="normal"><a href="#__codelineno-9-44">44</a></span>
<span class="normal"><a href="#__codelineno-9-45">45</a></span>
<span class="normal"><a href="#__codelineno-9-46">46</a></span>
<span class="normal"><a href="#__codelineno-9-47">47</a></span>
<span class="normal"><a href="#__codelineno-9-48">48</a></span>
<span class="normal"><a href="#__codelineno-9-49">49</a></span>
<span class="normal"><a href="#__codelineno-9-50">50</a></span>
<span class="normal"><a href="#__codelineno-9-51">51</a></span>
<span class="normal"><a href="#__codelineno-9-52">52</a></span>
<span class="normal"><a href="#__codelineno-9-53">53</a></span>
<span class="normal"><a href="#__codelineno-9-54">54</a></span>
<span class="normal"><a href="#__codelineno-9-55">55</a></span>
<span class="normal"><a href="#__codelineno-9-56">56</a></span>
<span class="normal"><a href="#__codelineno-9-57">57</a></span>
<span class="normal"><a href="#__codelineno-9-58">58</a></span>
<span class="normal"><a href="#__codelineno-9-59">59</a></span>
<span class="normal"><a href="#__codelineno-9-60">60</a></span>
<span class="normal"><a href="#__codelineno-9-61">61</a></span>
<span class="normal"><a href="#__codelineno-9-62">62</a></span>
<span class="normal"><a href="#__codelineno-9-63">63</a></span>
<span class="normal"><a href="#__codelineno-9-64">64</a></span>
<span class="normal"><a href="#__codelineno-9-65">65</a></span>
<span class="normal"><a href="#__codelineno-9-66">66</a></span>
<span class="normal"><a href="#__codelineno-9-67">67</a></span>
<span class="normal"><a href="#__codelineno-9-68">68</a></span>
<span class="normal"><a href="#__codelineno-9-69">69</a></span>
<span class="normal"><a href="#__codelineno-9-70">70</a></span>
<span class="normal"><a href="#__codelineno-9-71">71</a></span>
<span class="normal"><a href="#__codelineno-9-72">72</a></span>
<span class="normal"><a href="#__codelineno-9-73">73</a></span>
<span class="normal"><a href="#__codelineno-9-74">74</a></span>
<span class="normal"><a href="#__codelineno-9-75">75</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1"></a><span class="cm">/*</span>
<a id="__codelineno-9-2" name="__codelineno-9-2"></a><span class="cm"> * File name : StudentService.java 2023-04-20</span>
<a id="__codelineno-9-3" name="__codelineno-9-3"></a><span class="cm"> * @generated May 28, 2023, 9:37:49 AM</span>
<a id="__codelineno-9-4" name="__codelineno-9-4"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-9-5" name="__codelineno-9-5"></a><span class="cm"> * Copyright 2023 XUST. All rights reserved.</span>
<a id="__codelineno-9-6" name="__codelineno-9-6"></a><span class="cm"> */</span>
<a id="__codelineno-9-7" name="__codelineno-9-7"></a><span class="kn">package</span><span class="w"> </span><span class="nn">xust.stu.demo.service</span><span class="p">;</span>
<a id="__codelineno-9-8" name="__codelineno-9-8"></a>
<a id="__codelineno-9-9" name="__codelineno-9-9"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.io.OutputStream</span><span class="p">;</span>
<a id="__codelineno-9-10" name="__codelineno-9-10"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.Map</span><span class="p">;</span>
<a id="__codelineno-9-11" name="__codelineno-9-11"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.List</span><span class="p">;</span>
<a id="__codelineno-9-12" name="__codelineno-9-12"></a>
<a id="__codelineno-9-13" name="__codelineno-9-13"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.Result</span><span class="p">;</span>
<a id="__codelineno-9-14" name="__codelineno-9-14"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.domain.Student</span><span class="p">;</span>
<a id="__codelineno-9-15" name="__codelineno-9-15"></a>
<a id="__codelineno-9-16" name="__codelineno-9-16"></a><span class="cm">/**</span>
<a id="__codelineno-9-17" name="__codelineno-9-17"></a><span class="cm"> * Interface StudentService</span>
<a id="__codelineno-9-18" name="__codelineno-9-18"></a><span class="cm"> * Student service interface.</span>
<a id="__codelineno-9-19" name="__codelineno-9-19"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-9-20" name="__codelineno-9-20"></a><span class="cm"> * @version 1.0, 2023-04-20</span>
<a id="__codelineno-9-21" name="__codelineno-9-21"></a><span class="cm"> */</span>
<a id="__codelineno-9-22" name="__codelineno-9-22"></a><span class="kd">public</span><span class="w"> </span><span class="kd">interface</span> <span class="nc">StudentService</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-9-23" name="__codelineno-9-23"></a>
<a id="__codelineno-9-24" name="__codelineno-9-24"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-9-25" name="__codelineno-9-25"></a><span class="cm">   * 创建对象</span>
<a id="__codelineno-9-26" name="__codelineno-9-26"></a><span class="cm">   * @param newValue 新对象</span>
<a id="__codelineno-9-27" name="__codelineno-9-27"></a><span class="cm">   * @return 影响行数，1为成功，0为失败</span>
<a id="__codelineno-9-28" name="__codelineno-9-28"></a><span class="cm">   */</span>
<a id="__codelineno-9-29" name="__codelineno-9-29"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">create</span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">newValue</span><span class="p">);</span>
<a id="__codelineno-9-30" name="__codelineno-9-30"></a>
<a id="__codelineno-9-31" name="__codelineno-9-31"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-9-32" name="__codelineno-9-32"></a><span class="cm">   * 删除所有数据</span>
<a id="__codelineno-9-33" name="__codelineno-9-33"></a><span class="cm">   * @return 删除行数</span>
<a id="__codelineno-9-34" name="__codelineno-9-34"></a><span class="cm">   */</span>
<a id="__codelineno-9-35" name="__codelineno-9-35"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">deleteAll</span><span class="p">();</span>
<a id="__codelineno-9-36" name="__codelineno-9-36"></a>
<a id="__codelineno-9-37" name="__codelineno-9-37"></a><span class="w">  </span><span class="cm">/*</span>
<a id="__codelineno-9-38" name="__codelineno-9-38"></a><span class="cm">   * 删除指定条件筛选的数据</span>
<a id="__codelineno-9-39" name="__codelineno-9-39"></a><span class="cm">   * @return 删除行数</span>
<a id="__codelineno-9-40" name="__codelineno-9-40"></a><span class="cm">   */</span>
<a id="__codelineno-9-41" name="__codelineno-9-41"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">delete</span><span class="p">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">);</span>
<a id="__codelineno-9-42" name="__codelineno-9-42"></a>
<a id="__codelineno-9-43" name="__codelineno-9-43"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-9-44" name="__codelineno-9-44"></a><span class="cm">   * 删除对象</span>
<a id="__codelineno-9-45" name="__codelineno-9-45"></a><span class="cm">   * @param ids id列表</span>
<a id="__codelineno-9-46" name="__codelineno-9-46"></a><span class="cm">   * @return 非空Integer对象</span>
<a id="__codelineno-9-47" name="__codelineno-9-47"></a><span class="cm">   */</span>
<a id="__codelineno-9-48" name="__codelineno-9-48"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">deleteItems</span><span class="p">(</span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="w"> </span><span class="n">items</span><span class="p">);</span>
<a id="__codelineno-9-49" name="__codelineno-9-49"></a>
<a id="__codelineno-9-50" name="__codelineno-9-50"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-9-51" name="__codelineno-9-51"></a><span class="cm">   * 更新对象</span>
<a id="__codelineno-9-52" name="__codelineno-9-52"></a><span class="cm">   * @param newValue 新值</span>
<a id="__codelineno-9-53" name="__codelineno-9-53"></a><span class="cm">   * @return 非空Integer对象</span>
<a id="__codelineno-9-54" name="__codelineno-9-54"></a><span class="cm">   */</span>
<a id="__codelineno-9-55" name="__codelineno-9-55"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">update</span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">newValue</span><span class="p">);</span>
<a id="__codelineno-9-56" name="__codelineno-9-56"></a>
<a id="__codelineno-9-57" name="__codelineno-9-57"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-9-58" name="__codelineno-9-58"></a><span class="cm">   * 获取对象数量</span>
<a id="__codelineno-9-59" name="__codelineno-9-59"></a><span class="cm">   * @param params 并参数</span>
<a id="__codelineno-9-60" name="__codelineno-9-60"></a><span class="cm">   * @return 非空新对象，非空Integer对象</span>
<a id="__codelineno-9-61" name="__codelineno-9-61"></a><span class="cm">   */</span>
<a id="__codelineno-9-62" name="__codelineno-9-62"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">size</span><span class="p">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">);</span>
<a id="__codelineno-9-63" name="__codelineno-9-63"></a>
<a id="__codelineno-9-64" name="__codelineno-9-64"></a><span class="w">  </span><span class="cm">/**</span>
<a id="__codelineno-9-65" name="__codelineno-9-65"></a><span class="cm">   * 获取对象分页</span>
<a id="__codelineno-9-66" name="__codelineno-9-66"></a><span class="cm">   * @param params 并参数</span>
<a id="__codelineno-9-67" name="__codelineno-9-67"></a><span class="cm">   * @param pageNum 页码(从1开始),超出范围会返回边界页</span>
<a id="__codelineno-9-68" name="__codelineno-9-68"></a><span class="cm">   * @param pageSize 分页大小</span>
<a id="__codelineno-9-69" name="__codelineno-9-69"></a><span class="cm">   * @return 非空对象列表</span>
<a id="__codelineno-9-70" name="__codelineno-9-70"></a><span class="cm">   */</span>
<a id="__codelineno-9-71" name="__codelineno-9-71"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="nf">getPage</span><span class="p">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">pageNum</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">pageSize</span><span class="p">);</span>
<a id="__codelineno-9-72" name="__codelineno-9-72"></a>
<a id="__codelineno-9-73" name="__codelineno-9-73"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">export2XLS</span><span class="p">(</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">worksheet_name</span><span class="p">,</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">title</span><span class="p">,</span><span class="w"> </span><span class="n">OutputStream</span><span class="w"> </span><span class="n">output</span><span class="p">);</span>
<a id="__codelineno-9-74" name="__codelineno-9-74"></a>
<a id="__codelineno-9-75" name="__codelineno-9-75"></a><span class="p">}</span>
</code></pre></div></td></tr></table></div>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/java/xust/stu/demo/service/StudentServiceImpl.java</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-10-1">  1</a></span>
<span class="normal"><a href="#__codelineno-10-2">  2</a></span>
<span class="normal"><a href="#__codelineno-10-3">  3</a></span>
<span class="normal"><a href="#__codelineno-10-4">  4</a></span>
<span class="normal"><a href="#__codelineno-10-5">  5</a></span>
<span class="normal"><a href="#__codelineno-10-6">  6</a></span>
<span class="normal"><a href="#__codelineno-10-7">  7</a></span>
<span class="normal"><a href="#__codelineno-10-8">  8</a></span>
<span class="normal"><a href="#__codelineno-10-9">  9</a></span>
<span class="normal"><a href="#__codelineno-10-10"> 10</a></span>
<span class="normal"><a href="#__codelineno-10-11"> 11</a></span>
<span class="normal"><a href="#__codelineno-10-12"> 12</a></span>
<span class="normal"><a href="#__codelineno-10-13"> 13</a></span>
<span class="normal"><a href="#__codelineno-10-14"> 14</a></span>
<span class="normal"><a href="#__codelineno-10-15"> 15</a></span>
<span class="normal"><a href="#__codelineno-10-16"> 16</a></span>
<span class="normal"><a href="#__codelineno-10-17"> 17</a></span>
<span class="normal"><a href="#__codelineno-10-18"> 18</a></span>
<span class="normal"><a href="#__codelineno-10-19"> 19</a></span>
<span class="normal"><a href="#__codelineno-10-20"> 20</a></span>
<span class="normal"><a href="#__codelineno-10-21"> 21</a></span>
<span class="normal"><a href="#__codelineno-10-22"> 22</a></span>
<span class="normal"><a href="#__codelineno-10-23"> 23</a></span>
<span class="normal"><a href="#__codelineno-10-24"> 24</a></span>
<span class="normal"><a href="#__codelineno-10-25"> 25</a></span>
<span class="normal"><a href="#__codelineno-10-26"> 26</a></span>
<span class="normal"><a href="#__codelineno-10-27"> 27</a></span>
<span class="normal"><a href="#__codelineno-10-28"> 28</a></span>
<span class="normal"><a href="#__codelineno-10-29"> 29</a></span>
<span class="normal"><a href="#__codelineno-10-30"> 30</a></span>
<span class="normal"><a href="#__codelineno-10-31"> 31</a></span>
<span class="normal"><a href="#__codelineno-10-32"> 32</a></span>
<span class="normal"><a href="#__codelineno-10-33"> 33</a></span>
<span class="normal"><a href="#__codelineno-10-34"> 34</a></span>
<span class="normal"><a href="#__codelineno-10-35"> 35</a></span>
<span class="normal"><a href="#__codelineno-10-36"> 36</a></span>
<span class="normal"><a href="#__codelineno-10-37"> 37</a></span>
<span class="normal"><a href="#__codelineno-10-38"> 38</a></span>
<span class="normal"><a href="#__codelineno-10-39"> 39</a></span>
<span class="normal"><a href="#__codelineno-10-40"> 40</a></span>
<span class="normal"><a href="#__codelineno-10-41"> 41</a></span>
<span class="normal"><a href="#__codelineno-10-42"> 42</a></span>
<span class="normal"><a href="#__codelineno-10-43"> 43</a></span>
<span class="normal"><a href="#__codelineno-10-44"> 44</a></span>
<span class="normal"><a href="#__codelineno-10-45"> 45</a></span>
<span class="normal"><a href="#__codelineno-10-46"> 46</a></span>
<span class="normal"><a href="#__codelineno-10-47"> 47</a></span>
<span class="normal"><a href="#__codelineno-10-48"> 48</a></span>
<span class="normal"><a href="#__codelineno-10-49"> 49</a></span>
<span class="normal"><a href="#__codelineno-10-50"> 50</a></span>
<span class="normal"><a href="#__codelineno-10-51"> 51</a></span>
<span class="normal"><a href="#__codelineno-10-52"> 52</a></span>
<span class="normal"><a href="#__codelineno-10-53"> 53</a></span>
<span class="normal"><a href="#__codelineno-10-54"> 54</a></span>
<span class="normal"><a href="#__codelineno-10-55"> 55</a></span>
<span class="normal"><a href="#__codelineno-10-56"> 56</a></span>
<span class="normal"><a href="#__codelineno-10-57"> 57</a></span>
<span class="normal"><a href="#__codelineno-10-58"> 58</a></span>
<span class="normal"><a href="#__codelineno-10-59"> 59</a></span>
<span class="normal"><a href="#__codelineno-10-60"> 60</a></span>
<span class="normal"><a href="#__codelineno-10-61"> 61</a></span>
<span class="normal"><a href="#__codelineno-10-62"> 62</a></span>
<span class="normal"><a href="#__codelineno-10-63"> 63</a></span>
<span class="normal"><a href="#__codelineno-10-64"> 64</a></span>
<span class="normal"><a href="#__codelineno-10-65"> 65</a></span>
<span class="normal"><a href="#__codelineno-10-66"> 66</a></span>
<span class="normal"><a href="#__codelineno-10-67"> 67</a></span>
<span class="normal"><a href="#__codelineno-10-68"> 68</a></span>
<span class="normal"><a href="#__codelineno-10-69"> 69</a></span>
<span class="normal"><a href="#__codelineno-10-70"> 70</a></span>
<span class="normal"><a href="#__codelineno-10-71"> 71</a></span>
<span class="normal"><a href="#__codelineno-10-72"> 72</a></span>
<span class="normal"><a href="#__codelineno-10-73"> 73</a></span>
<span class="normal"><a href="#__codelineno-10-74"> 74</a></span>
<span class="normal"><a href="#__codelineno-10-75"> 75</a></span>
<span class="normal"><a href="#__codelineno-10-76"> 76</a></span>
<span class="normal"><a href="#__codelineno-10-77"> 77</a></span>
<span class="normal"><a href="#__codelineno-10-78"> 78</a></span>
<span class="normal"><a href="#__codelineno-10-79"> 79</a></span>
<span class="normal"><a href="#__codelineno-10-80"> 80</a></span>
<span class="normal"><a href="#__codelineno-10-81"> 81</a></span>
<span class="normal"><a href="#__codelineno-10-82"> 82</a></span>
<span class="normal"><a href="#__codelineno-10-83"> 83</a></span>
<span class="normal"><a href="#__codelineno-10-84"> 84</a></span>
<span class="normal"><a href="#__codelineno-10-85"> 85</a></span>
<span class="normal"><a href="#__codelineno-10-86"> 86</a></span>
<span class="normal"><a href="#__codelineno-10-87"> 87</a></span>
<span class="normal"><a href="#__codelineno-10-88"> 88</a></span>
<span class="normal"><a href="#__codelineno-10-89"> 89</a></span>
<span class="normal"><a href="#__codelineno-10-90"> 90</a></span>
<span class="normal"><a href="#__codelineno-10-91"> 91</a></span>
<span class="normal"><a href="#__codelineno-10-92"> 92</a></span>
<span class="normal"><a href="#__codelineno-10-93"> 93</a></span>
<span class="normal"><a href="#__codelineno-10-94"> 94</a></span>
<span class="normal"><a href="#__codelineno-10-95"> 95</a></span>
<span class="normal"><a href="#__codelineno-10-96"> 96</a></span>
<span class="normal"><a href="#__codelineno-10-97"> 97</a></span>
<span class="normal"><a href="#__codelineno-10-98"> 98</a></span>
<span class="normal"><a href="#__codelineno-10-99"> 99</a></span>
<span class="normal"><a href="#__codelineno-10-100">100</a></span>
<span class="normal"><a href="#__codelineno-10-101">101</a></span>
<span class="normal"><a href="#__codelineno-10-102">102</a></span>
<span class="normal"><a href="#__codelineno-10-103">103</a></span>
<span class="normal"><a href="#__codelineno-10-104">104</a></span>
<span class="normal"><a href="#__codelineno-10-105">105</a></span>
<span class="normal"><a href="#__codelineno-10-106">106</a></span>
<span class="normal"><a href="#__codelineno-10-107">107</a></span>
<span class="normal"><a href="#__codelineno-10-108">108</a></span>
<span class="normal"><a href="#__codelineno-10-109">109</a></span>
<span class="normal"><a href="#__codelineno-10-110">110</a></span>
<span class="normal"><a href="#__codelineno-10-111">111</a></span>
<span class="normal"><a href="#__codelineno-10-112">112</a></span>
<span class="normal"><a href="#__codelineno-10-113">113</a></span>
<span class="normal"><a href="#__codelineno-10-114">114</a></span>
<span class="normal"><a href="#__codelineno-10-115">115</a></span>
<span class="normal"><a href="#__codelineno-10-116">116</a></span>
<span class="normal"><a href="#__codelineno-10-117">117</a></span>
<span class="normal"><a href="#__codelineno-10-118">118</a></span>
<span class="normal"><a href="#__codelineno-10-119">119</a></span>
<span class="normal"><a href="#__codelineno-10-120">120</a></span>
<span class="normal"><a href="#__codelineno-10-121">121</a></span>
<span class="normal"><a href="#__codelineno-10-122">122</a></span>
<span class="normal"><a href="#__codelineno-10-123">123</a></span>
<span class="normal"><a href="#__codelineno-10-124">124</a></span>
<span class="normal"><a href="#__codelineno-10-125">125</a></span>
<span class="normal"><a href="#__codelineno-10-126">126</a></span>
<span class="normal"><a href="#__codelineno-10-127">127</a></span>
<span class="normal"><a href="#__codelineno-10-128">128</a></span>
<span class="normal"><a href="#__codelineno-10-129">129</a></span>
<span class="normal"><a href="#__codelineno-10-130">130</a></span>
<span class="normal"><a href="#__codelineno-10-131">131</a></span>
<span class="normal"><a href="#__codelineno-10-132">132</a></span>
<span class="normal"><a href="#__codelineno-10-133">133</a></span>
<span class="normal"><a href="#__codelineno-10-134">134</a></span>
<span class="normal"><a href="#__codelineno-10-135">135</a></span>
<span class="normal"><a href="#__codelineno-10-136">136</a></span>
<span class="normal"><a href="#__codelineno-10-137">137</a></span>
<span class="normal"><a href="#__codelineno-10-138">138</a></span>
<span class="normal"><a href="#__codelineno-10-139">139</a></span>
<span class="normal"><a href="#__codelineno-10-140">140</a></span>
<span class="normal"><a href="#__codelineno-10-141">141</a></span>
<span class="normal"><a href="#__codelineno-10-142">142</a></span>
<span class="normal"><a href="#__codelineno-10-143">143</a></span>
<span class="normal"><a href="#__codelineno-10-144">144</a></span>
<span class="normal"><a href="#__codelineno-10-145">145</a></span>
<span class="normal"><a href="#__codelineno-10-146">146</a></span>
<span class="normal"><a href="#__codelineno-10-147">147</a></span>
<span class="normal"><a href="#__codelineno-10-148">148</a></span>
<span class="normal"><a href="#__codelineno-10-149">149</a></span>
<span class="normal"><a href="#__codelineno-10-150">150</a></span>
<span class="normal"><a href="#__codelineno-10-151">151</a></span>
<span class="normal"><a href="#__codelineno-10-152">152</a></span>
<span class="normal"><a href="#__codelineno-10-153">153</a></span>
<span class="normal"><a href="#__codelineno-10-154">154</a></span>
<span class="normal"><a href="#__codelineno-10-155">155</a></span>
<span class="normal"><a href="#__codelineno-10-156">156</a></span>
<span class="normal"><a href="#__codelineno-10-157">157</a></span>
<span class="normal"><a href="#__codelineno-10-158">158</a></span>
<span class="normal"><a href="#__codelineno-10-159">159</a></span>
<span class="normal"><a href="#__codelineno-10-160">160</a></span>
<span class="normal"><a href="#__codelineno-10-161">161</a></span>
<span class="normal"><a href="#__codelineno-10-162">162</a></span>
<span class="normal"><a href="#__codelineno-10-163">163</a></span>
<span class="normal"><a href="#__codelineno-10-164">164</a></span>
<span class="normal"><a href="#__codelineno-10-165">165</a></span>
<span class="normal"><a href="#__codelineno-10-166">166</a></span>
<span class="normal"><a href="#__codelineno-10-167">167</a></span>
<span class="normal"><a href="#__codelineno-10-168">168</a></span>
<span class="normal"><a href="#__codelineno-10-169">169</a></span>
<span class="normal"><a href="#__codelineno-10-170">170</a></span>
<span class="normal"><a href="#__codelineno-10-171">171</a></span>
<span class="normal"><a href="#__codelineno-10-172">172</a></span>
<span class="normal"><a href="#__codelineno-10-173">173</a></span>
<span class="normal"><a href="#__codelineno-10-174">174</a></span>
<span class="normal"><a href="#__codelineno-10-175">175</a></span>
<span class="normal"><a href="#__codelineno-10-176">176</a></span>
<span class="normal"><a href="#__codelineno-10-177">177</a></span>
<span class="normal"><a href="#__codelineno-10-178">178</a></span>
<span class="normal"><a href="#__codelineno-10-179">179</a></span>
<span class="normal"><a href="#__codelineno-10-180">180</a></span>
<span class="normal"><a href="#__codelineno-10-181">181</a></span>
<span class="normal"><a href="#__codelineno-10-182">182</a></span>
<span class="normal"><a href="#__codelineno-10-183">183</a></span>
<span class="normal"><a href="#__codelineno-10-184">184</a></span>
<span class="normal"><a href="#__codelineno-10-185">185</a></span>
<span class="normal"><a href="#__codelineno-10-186">186</a></span>
<span class="normal"><a href="#__codelineno-10-187">187</a></span>
<span class="normal"><a href="#__codelineno-10-188">188</a></span>
<span class="normal"><a href="#__codelineno-10-189">189</a></span>
<span class="normal"><a href="#__codelineno-10-190">190</a></span>
<span class="normal"><a href="#__codelineno-10-191">191</a></span>
<span class="normal"><a href="#__codelineno-10-192">192</a></span>
<span class="normal"><a href="#__codelineno-10-193">193</a></span>
<span class="normal"><a href="#__codelineno-10-194">194</a></span>
<span class="normal"><a href="#__codelineno-10-195">195</a></span>
<span class="normal"><a href="#__codelineno-10-196">196</a></span>
<span class="normal"><a href="#__codelineno-10-197">197</a></span>
<span class="normal"><a href="#__codelineno-10-198">198</a></span>
<span class="normal"><a href="#__codelineno-10-199">199</a></span>
<span class="normal"><a href="#__codelineno-10-200">200</a></span>
<span class="normal"><a href="#__codelineno-10-201">201</a></span>
<span class="normal"><a href="#__codelineno-10-202">202</a></span>
<span class="normal"><a href="#__codelineno-10-203">203</a></span>
<span class="normal"><a href="#__codelineno-10-204">204</a></span>
<span class="normal"><a href="#__codelineno-10-205">205</a></span>
<span class="normal"><a href="#__codelineno-10-206">206</a></span>
<span class="normal"><a href="#__codelineno-10-207">207</a></span>
<span class="normal"><a href="#__codelineno-10-208">208</a></span>
<span class="normal"><a href="#__codelineno-10-209">209</a></span>
<span class="normal"><a href="#__codelineno-10-210">210</a></span>
<span class="normal"><a href="#__codelineno-10-211">211</a></span>
<span class="normal"><a href="#__codelineno-10-212">212</a></span>
<span class="normal"><a href="#__codelineno-10-213">213</a></span>
<span class="normal"><a href="#__codelineno-10-214">214</a></span>
<span class="normal"><a href="#__codelineno-10-215">215</a></span>
<span class="normal"><a href="#__codelineno-10-216">216</a></span>
<span class="normal"><a href="#__codelineno-10-217">217</a></span>
<span class="normal"><a href="#__codelineno-10-218">218</a></span>
<span class="normal"><a href="#__codelineno-10-219">219</a></span>
<span class="normal"><a href="#__codelineno-10-220">220</a></span>
<span class="normal"><a href="#__codelineno-10-221">221</a></span>
<span class="normal"><a href="#__codelineno-10-222">222</a></span>
<span class="normal"><a href="#__codelineno-10-223">223</a></span>
<span class="normal"><a href="#__codelineno-10-224">224</a></span>
<span class="normal"><a href="#__codelineno-10-225">225</a></span>
<span class="normal"><a href="#__codelineno-10-226">226</a></span>
<span class="normal"><a href="#__codelineno-10-227">227</a></span>
<span class="normal"><a href="#__codelineno-10-228">228</a></span>
<span class="normal"><a href="#__codelineno-10-229">229</a></span>
<span class="normal"><a href="#__codelineno-10-230">230</a></span>
<span class="normal"><a href="#__codelineno-10-231">231</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1"></a><span class="kn">package</span><span class="w"> </span><span class="nn">xust.stu.demo.service</span><span class="p">;</span>
<a id="__codelineno-10-2" name="__codelineno-10-2"></a>
<a id="__codelineno-10-3" name="__codelineno-10-3"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.io.OutputStream</span><span class="p">;</span>
<a id="__codelineno-10-4" name="__codelineno-10-4"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.ArrayList</span><span class="p">;</span>
<a id="__codelineno-10-5" name="__codelineno-10-5"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.List</span><span class="p">;</span>
<a id="__codelineno-10-6" name="__codelineno-10-6"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.Map</span><span class="p">;</span>
<a id="__codelineno-10-7" name="__codelineno-10-7"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.UUID</span><span class="p">;</span>
<a id="__codelineno-10-8" name="__codelineno-10-8"></a>
<a id="__codelineno-10-9" name="__codelineno-10-9"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.slf4j.Logger</span><span class="p">;</span>
<a id="__codelineno-10-10" name="__codelineno-10-10"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.slf4j.LoggerFactory</span><span class="p">;</span>
<a id="__codelineno-10-11" name="__codelineno-10-11"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.poi.hssf.usermodel.HSSFCell</span><span class="p">;</span>
<a id="__codelineno-10-12" name="__codelineno-10-12"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.poi.hssf.usermodel.HSSFRow</span><span class="p">;</span>
<a id="__codelineno-10-13" name="__codelineno-10-13"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.poi.hssf.usermodel.HSSFSheet</span><span class="p">;</span>
<a id="__codelineno-10-14" name="__codelineno-10-14"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.poi.hssf.usermodel.HSSFWorkbook</span><span class="p">;</span>
<a id="__codelineno-10-15" name="__codelineno-10-15"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.poi.ss.util.CellRangeAddress</span><span class="p">;</span>
<a id="__codelineno-10-16" name="__codelineno-10-16"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.beans.factory.annotation.Autowired</span><span class="p">;</span>
<a id="__codelineno-10-17" name="__codelineno-10-17"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.stereotype.Service</span><span class="p">;</span>
<a id="__codelineno-10-18" name="__codelineno-10-18"></a>
<a id="__codelineno-10-19" name="__codelineno-10-19"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.Result</span><span class="p">;</span>
<a id="__codelineno-10-20" name="__codelineno-10-20"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.ErrEnum</span><span class="p">;</span>
<a id="__codelineno-10-21" name="__codelineno-10-21"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.dao.StudentDao</span><span class="p">;</span>
<a id="__codelineno-10-22" name="__codelineno-10-22"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.domain.Student</span><span class="p">;</span>
<a id="__codelineno-10-23" name="__codelineno-10-23"></a>
<a id="__codelineno-10-24" name="__codelineno-10-24"></a><span class="cm">/**</span>
<a id="__codelineno-10-25" name="__codelineno-10-25"></a><span class="cm"> * Class StudentServiceImpl</span>
<a id="__codelineno-10-26" name="__codelineno-10-26"></a><span class="cm"> * StudentService interface implementation.</span>
<a id="__codelineno-10-27" name="__codelineno-10-27"></a><span class="cm"> * @generated May 28, 2023, 9:37:49 AM</span>
<a id="__codelineno-10-28" name="__codelineno-10-28"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-10-29" name="__codelineno-10-29"></a><span class="cm"> * @version 1.0, 2023-04-20</span>
<a id="__codelineno-10-30" name="__codelineno-10-30"></a><span class="cm"> */</span>
<a id="__codelineno-10-31" name="__codelineno-10-31"></a><span class="nd">@Service</span>
<a id="__codelineno-10-32" name="__codelineno-10-32"></a><span class="kd">public</span><span class="w"> </span><span class="kd">class</span> <span class="nc">StudentServiceImpl</span><span class="w"> </span><span class="kd">implements</span><span class="w"> </span><span class="n">StudentService</span><span class="p">{</span>
<a id="__codelineno-10-33" name="__codelineno-10-33"></a><span class="w">  </span><span class="kd">private</span><span class="w"> </span><span class="kd">final</span><span class="w"> </span><span class="kd">static</span><span class="w"> </span><span class="n">Logger</span><span class="w"> </span><span class="n">log</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">LoggerFactory</span><span class="p">.</span><span class="na">getLogger</span><span class="p">(</span><span class="n">StudentServiceImpl</span><span class="p">.</span><span class="na">class</span><span class="p">);</span>
<a id="__codelineno-10-34" name="__codelineno-10-34"></a>
<a id="__codelineno-10-35" name="__codelineno-10-35"></a><span class="w">  </span><span class="nd">@Autowired</span>
<a id="__codelineno-10-36" name="__codelineno-10-36"></a><span class="w">  </span><span class="kd">private</span><span class="w"> </span><span class="n">StudentDao</span><span class="w"> </span><span class="n">studentDao</span><span class="p">;</span>
<a id="__codelineno-10-37" name="__codelineno-10-37"></a>
<a id="__codelineno-10-38" name="__codelineno-10-38"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-39" name="__codelineno-10-39"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">create</span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-40" name="__codelineno-10-40"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-41" name="__codelineno-10-41"></a>
<a id="__codelineno-10-42" name="__codelineno-10-42"></a><span class="w">    </span><span class="k">try</span><span class="p">{</span>
<a id="__codelineno-10-43" name="__codelineno-10-43"></a><span class="w">      </span><span class="c1">//newValue.setSys_create_date(new Date());</span>
<a id="__codelineno-10-44" name="__codelineno-10-44"></a><span class="w">      </span><span class="n">newValue</span><span class="p">.</span><span class="na">setId</span><span class="p">(</span><span class="n">UUID</span><span class="p">.</span><span class="na">randomUUID</span><span class="p">().</span><span class="na">toString</span><span class="p">());</span>
<a id="__codelineno-10-45" name="__codelineno-10-45"></a><span class="w">      </span><span class="kt">int</span><span class="w"> </span><span class="n">effected</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentDao</span><span class="p">.</span><span class="na">create</span><span class="p">(</span><span class="n">newValue</span><span class="p">);</span>
<a id="__codelineno-10-46" name="__codelineno-10-46"></a><span class="w">      </span><span class="k">if</span><span class="p">(</span><span class="n">effected</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">){</span>
<a id="__codelineno-10-47" name="__codelineno-10-47"></a><span class="w">        </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">newValue</span><span class="p">);</span>
<a id="__codelineno-10-48" name="__codelineno-10-48"></a><span class="w">      </span><span class="p">}</span><span class="k">else</span><span class="p">{</span>
<a id="__codelineno-10-49" name="__codelineno-10-49"></a><span class="w">        </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_CREATE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-50" name="__codelineno-10-50"></a><span class="w">      </span><span class="p">}</span>
<a id="__codelineno-10-51" name="__codelineno-10-51"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">){</span>
<a id="__codelineno-10-52" name="__codelineno-10-52"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_CREATE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-53" name="__codelineno-10-53"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-54" name="__codelineno-10-54"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-55" name="__codelineno-10-55"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-56" name="__codelineno-10-56"></a>
<a id="__codelineno-10-57" name="__codelineno-10-57"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-58" name="__codelineno-10-58"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-59" name="__codelineno-10-59"></a>
<a id="__codelineno-10-60" name="__codelineno-10-60"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-61" name="__codelineno-10-61"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">deleteAll</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-62" name="__codelineno-10-62"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-63" name="__codelineno-10-63"></a>
<a id="__codelineno-10-64" name="__codelineno-10-64"></a><span class="w">    </span><span class="k">try</span><span class="p">{</span>
<a id="__codelineno-10-65" name="__codelineno-10-65"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">studentDao</span><span class="p">.</span><span class="na">deleteAll</span><span class="p">());</span>
<a id="__codelineno-10-66" name="__codelineno-10-66"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">){</span>
<a id="__codelineno-10-67" name="__codelineno-10-67"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_DELETE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-68" name="__codelineno-10-68"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-69" name="__codelineno-10-69"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-70" name="__codelineno-10-70"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-71" name="__codelineno-10-71"></a>
<a id="__codelineno-10-72" name="__codelineno-10-72"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-73" name="__codelineno-10-73"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-74" name="__codelineno-10-74"></a>
<a id="__codelineno-10-75" name="__codelineno-10-75"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-76" name="__codelineno-10-76"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">deleteItems</span><span class="p">(</span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="w"> </span><span class="n">items</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-77" name="__codelineno-10-77"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-78" name="__codelineno-10-78"></a>
<a id="__codelineno-10-79" name="__codelineno-10-79"></a><span class="w">    </span><span class="k">try</span><span class="p">{</span>
<a id="__codelineno-10-80" name="__codelineno-10-80"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">studentDao</span><span class="p">.</span><span class="na">deleteItems</span><span class="p">(</span><span class="n">items</span><span class="p">));</span>
<a id="__codelineno-10-81" name="__codelineno-10-81"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">){</span>
<a id="__codelineno-10-82" name="__codelineno-10-82"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_DELETE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-83" name="__codelineno-10-83"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-84" name="__codelineno-10-84"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-85" name="__codelineno-10-85"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-86" name="__codelineno-10-86"></a>
<a id="__codelineno-10-87" name="__codelineno-10-87"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-88" name="__codelineno-10-88"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-89" name="__codelineno-10-89"></a>
<a id="__codelineno-10-90" name="__codelineno-10-90"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-91" name="__codelineno-10-91"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">delete</span><span class="p">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-92" name="__codelineno-10-92"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-93" name="__codelineno-10-93"></a>
<a id="__codelineno-10-94" name="__codelineno-10-94"></a><span class="w">    </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-95" name="__codelineno-10-95"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">studentDao</span><span class="p">.</span><span class="na">delete</span><span class="p">(</span><span class="n">params</span><span class="p">));</span>
<a id="__codelineno-10-96" name="__codelineno-10-96"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-97" name="__codelineno-10-97"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_DELETE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-98" name="__codelineno-10-98"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-99" name="__codelineno-10-99"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-100" name="__codelineno-10-100"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-101" name="__codelineno-10-101"></a>
<a id="__codelineno-10-102" name="__codelineno-10-102"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-103" name="__codelineno-10-103"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-104" name="__codelineno-10-104"></a>
<a id="__codelineno-10-105" name="__codelineno-10-105"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-106" name="__codelineno-10-106"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">update</span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">newValue</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-107" name="__codelineno-10-107"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-108" name="__codelineno-10-108"></a><span class="w">    </span><span class="k">try</span><span class="p">{</span>
<a id="__codelineno-10-109" name="__codelineno-10-109"></a><span class="w">      </span><span class="c1">//newValue.setSys_last_update_date(new Date());</span>
<a id="__codelineno-10-110" name="__codelineno-10-110"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">studentDao</span><span class="p">.</span><span class="na">update</span><span class="p">(</span><span class="n">newValue</span><span class="p">));</span>
<a id="__codelineno-10-111" name="__codelineno-10-111"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">){</span>
<a id="__codelineno-10-112" name="__codelineno-10-112"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_UPDATE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-113" name="__codelineno-10-113"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-114" name="__codelineno-10-114"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-115" name="__codelineno-10-115"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-116" name="__codelineno-10-116"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-117" name="__codelineno-10-117"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-118" name="__codelineno-10-118"></a>
<a id="__codelineno-10-119" name="__codelineno-10-119"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-120" name="__codelineno-10-120"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">size</span><span class="p">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-121" name="__codelineno-10-121"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-122" name="__codelineno-10-122"></a>
<a id="__codelineno-10-123" name="__codelineno-10-123"></a><span class="w">    </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-124" name="__codelineno-10-124"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">studentDao</span><span class="p">.</span><span class="na">size</span><span class="p">(</span><span class="n">params</span><span class="p">));</span>
<a id="__codelineno-10-125" name="__codelineno-10-125"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-126" name="__codelineno-10-126"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_SIZE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-127" name="__codelineno-10-127"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-128" name="__codelineno-10-128"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-129" name="__codelineno-10-129"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-130" name="__codelineno-10-130"></a>
<a id="__codelineno-10-131" name="__codelineno-10-131"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-132" name="__codelineno-10-132"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-133" name="__codelineno-10-133"></a>
<a id="__codelineno-10-134" name="__codelineno-10-134"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-135" name="__codelineno-10-135"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="nf">getPage</span><span class="p">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">pageNum</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">pageSize</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-136" name="__codelineno-10-136"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="p">();</span>
<a id="__codelineno-10-137" name="__codelineno-10-137"></a><span class="w">    </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="k">new</span><span class="w"> </span><span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="p">());</span>
<a id="__codelineno-10-138" name="__codelineno-10-138"></a>
<a id="__codelineno-10-139" name="__codelineno-10-139"></a><span class="w">    </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-140" name="__codelineno-10-140"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">studentDao</span><span class="p">.</span><span class="na">getPage</span><span class="p">(</span><span class="n">params</span><span class="p">,</span><span class="w"> </span><span class="n">pageNum</span><span class="p">,</span><span class="w"> </span><span class="n">pageSize</span><span class="p">));</span>
<a id="__codelineno-10-141" name="__codelineno-10-141"></a><span class="w">    </span><span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-142" name="__codelineno-10-142"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">DB_PAGE_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-143" name="__codelineno-10-143"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-144" name="__codelineno-10-144"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-145" name="__codelineno-10-145"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-146" name="__codelineno-10-146"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-147" name="__codelineno-10-147"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-148" name="__codelineno-10-148"></a>
<a id="__codelineno-10-149" name="__codelineno-10-149"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">buildXLSTemplate</span><span class="p">(</span><span class="n">String</span><span class="w"> </span><span class="n">worksheet_name</span><span class="p">,</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">title</span><span class="p">,</span><span class="w"> </span><span class="n">OutputStream</span><span class="w"> </span><span class="n">output</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-150" name="__codelineno-10-150"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-151" name="__codelineno-10-151"></a>
<a id="__codelineno-10-152" name="__codelineno-10-152"></a><span class="w">    </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-153" name="__codelineno-10-153"></a><span class="w">      </span><span class="n">HSSFWorkbook</span><span class="w"> </span><span class="n">wb</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">HSSFWorkbook</span><span class="p">();</span>
<a id="__codelineno-10-154" name="__codelineno-10-154"></a><span class="w">      </span><span class="n">HSSFSheet</span><span class="w"> </span><span class="n">sheet</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">wb</span><span class="p">.</span><span class="na">createSheet</span><span class="p">(</span><span class="n">worksheet_name</span><span class="p">);</span>
<a id="__codelineno-10-155" name="__codelineno-10-155"></a>
<a id="__codelineno-10-156" name="__codelineno-10-156"></a><span class="w">      </span><span class="c1">// Header title</span>
<a id="__codelineno-10-157" name="__codelineno-10-157"></a><span class="w">      </span><span class="n">HSSFRow</span><span class="w"> </span><span class="n">row1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sheet</span><span class="p">.</span><span class="na">createRow</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<a id="__codelineno-10-158" name="__codelineno-10-158"></a><span class="w">      </span><span class="n">HSSFCell</span><span class="w"> </span><span class="n">cell</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">row1</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<a id="__codelineno-10-159" name="__codelineno-10-159"></a><span class="w">      </span><span class="n">cell</span><span class="p">.</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">title</span><span class="p">);</span>
<a id="__codelineno-10-160" name="__codelineno-10-160"></a><span class="w">      </span><span class="n">sheet</span><span class="p">.</span><span class="na">addMergedRegion</span><span class="p">(</span><span class="k">new</span><span class="w"> </span><span class="n">CellRangeAddress</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">));</span>
<a id="__codelineno-10-161" name="__codelineno-10-161"></a>
<a id="__codelineno-10-162" name="__codelineno-10-162"></a><span class="w">      </span><span class="c1">// Header</span>
<a id="__codelineno-10-163" name="__codelineno-10-163"></a><span class="w">      </span><span class="n">HSSFRow</span><span class="w"> </span><span class="n">row2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sheet</span><span class="p">.</span><span class="na">createRow</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<a id="__codelineno-10-164" name="__codelineno-10-164"></a><span class="w">      </span><span class="c1">// 设置列标题</span>
<a id="__codelineno-10-165" name="__codelineno-10-165"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">0</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;学号&quot;</span><span class="p">);</span>
<a id="__codelineno-10-166" name="__codelineno-10-166"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;姓名&quot;</span><span class="p">);</span>
<a id="__codelineno-10-167" name="__codelineno-10-167"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">2</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;性别&quot;</span><span class="p">);</span>
<a id="__codelineno-10-168" name="__codelineno-10-168"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">3</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;年龄&quot;</span><span class="p">);</span>
<a id="__codelineno-10-169" name="__codelineno-10-169"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">4</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;所在系&quot;</span><span class="p">);</span>
<a id="__codelineno-10-170" name="__codelineno-10-170"></a>
<a id="__codelineno-10-171" name="__codelineno-10-171"></a><span class="w">      </span><span class="n">wb</span><span class="p">.</span><span class="na">write</span><span class="p">(</span><span class="n">output</span><span class="p">);</span>
<a id="__codelineno-10-172" name="__codelineno-10-172"></a><span class="w">      </span><span class="c1">//wb.close();</span>
<a id="__codelineno-10-173" name="__codelineno-10-173"></a><span class="w">    </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-174" name="__codelineno-10-174"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">EXPORT_EXCEL_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-175" name="__codelineno-10-175"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-176" name="__codelineno-10-176"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-177" name="__codelineno-10-177"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-178" name="__codelineno-10-178"></a>
<a id="__codelineno-10-179" name="__codelineno-10-179"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-180" name="__codelineno-10-180"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-181" name="__codelineno-10-181"></a>
<a id="__codelineno-10-182" name="__codelineno-10-182"></a><span class="w">  </span><span class="nd">@Override</span>
<a id="__codelineno-10-183" name="__codelineno-10-183"></a><span class="w">  </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">export2XLS</span><span class="p">(</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">worksheet_name</span><span class="p">,</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="n">title</span><span class="p">,</span><span class="w"> </span><span class="n">OutputStream</span><span class="w"> </span><span class="n">output</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-184" name="__codelineno-10-184"></a><span class="w">    </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-10-185" name="__codelineno-10-185"></a>
<a id="__codelineno-10-186" name="__codelineno-10-186"></a><span class="w">    </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-187" name="__codelineno-10-187"></a><span class="w">      </span><span class="n">HSSFWorkbook</span><span class="w"> </span><span class="n">wb</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">HSSFWorkbook</span><span class="p">();</span>
<a id="__codelineno-10-188" name="__codelineno-10-188"></a><span class="w">      </span><span class="n">HSSFSheet</span><span class="w"> </span><span class="n">sheet</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">wb</span><span class="p">.</span><span class="na">createSheet</span><span class="p">(</span><span class="n">worksheet_name</span><span class="p">);</span>
<a id="__codelineno-10-189" name="__codelineno-10-189"></a>
<a id="__codelineno-10-190" name="__codelineno-10-190"></a><span class="w">      </span><span class="c1">// Header title</span>
<a id="__codelineno-10-191" name="__codelineno-10-191"></a><span class="w">      </span><span class="n">HSSFRow</span><span class="w"> </span><span class="n">row1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sheet</span><span class="p">.</span><span class="na">createRow</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<a id="__codelineno-10-192" name="__codelineno-10-192"></a><span class="w">      </span><span class="n">HSSFCell</span><span class="w"> </span><span class="n">cell</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">row1</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<a id="__codelineno-10-193" name="__codelineno-10-193"></a><span class="w">      </span><span class="n">cell</span><span class="p">.</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">title</span><span class="p">);</span>
<a id="__codelineno-10-194" name="__codelineno-10-194"></a><span class="w">      </span><span class="n">sheet</span><span class="p">.</span><span class="na">addMergedRegion</span><span class="p">(</span><span class="k">new</span><span class="w"> </span><span class="n">CellRangeAddress</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">5</span><span class="p">));</span>
<a id="__codelineno-10-195" name="__codelineno-10-195"></a>
<a id="__codelineno-10-196" name="__codelineno-10-196"></a><span class="w">      </span><span class="c1">// Header</span>
<a id="__codelineno-10-197" name="__codelineno-10-197"></a><span class="w">      </span><span class="n">HSSFRow</span><span class="w"> </span><span class="n">row2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sheet</span><span class="p">.</span><span class="na">createRow</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<a id="__codelineno-10-198" name="__codelineno-10-198"></a><span class="w">      </span><span class="c1">// 设置列标题</span>
<a id="__codelineno-10-199" name="__codelineno-10-199"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">0</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;Id&quot;</span><span class="p">);</span>
<a id="__codelineno-10-200" name="__codelineno-10-200"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;学号&quot;</span><span class="p">);</span>
<a id="__codelineno-10-201" name="__codelineno-10-201"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">2</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;姓名&quot;</span><span class="p">);</span>
<a id="__codelineno-10-202" name="__codelineno-10-202"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">3</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;性别&quot;</span><span class="p">);</span>
<a id="__codelineno-10-203" name="__codelineno-10-203"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">4</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;年龄&quot;</span><span class="p">);</span>
<a id="__codelineno-10-204" name="__codelineno-10-204"></a><span class="w">      </span><span class="n">row2</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">5</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="s">&quot;所在系&quot;</span><span class="p">);</span>
<a id="__codelineno-10-205" name="__codelineno-10-205"></a>
<a id="__codelineno-10-206" name="__codelineno-10-206"></a><span class="w">      </span><span class="c1">// 填充数据</span>
<a id="__codelineno-10-207" name="__codelineno-10-207"></a><span class="w">      </span><span class="kt">int</span><span class="w"> </span><span class="n">row_number</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span>
<a id="__codelineno-10-208" name="__codelineno-10-208"></a><span class="w">      </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">Student</span><span class="w"> </span><span class="n">item</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">data</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-209" name="__codelineno-10-209"></a><span class="w">        </span><span class="n">HSSFRow</span><span class="w"> </span><span class="n">row_new</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sheet</span><span class="p">.</span><span class="na">createRow</span><span class="p">(</span><span class="n">row_number</span><span class="o">++</span><span class="p">);</span>
<a id="__codelineno-10-210" name="__codelineno-10-210"></a><span class="w">        </span><span class="n">row_new</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">0</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">NullValue</span><span class="p">(</span><span class="n">item</span><span class="p">.</span><span class="na">getId</span><span class="p">()));</span>
<a id="__codelineno-10-211" name="__codelineno-10-211"></a><span class="w">        </span><span class="n">row_new</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">NullValue</span><span class="p">(</span><span class="n">item</span><span class="p">.</span><span class="na">getNo</span><span class="p">()));</span>
<a id="__codelineno-10-212" name="__codelineno-10-212"></a><span class="w">        </span><span class="n">row_new</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">2</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">NullValue</span><span class="p">(</span><span class="n">item</span><span class="p">.</span><span class="na">getName</span><span class="p">()));</span>
<a id="__codelineno-10-213" name="__codelineno-10-213"></a><span class="w">        </span><span class="n">row_new</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">3</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">NullValue</span><span class="p">(</span><span class="n">item</span><span class="p">.</span><span class="na">getGender</span><span class="p">()));</span>
<a id="__codelineno-10-214" name="__codelineno-10-214"></a><span class="w">        </span><span class="n">row_new</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">4</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">NullValue</span><span class="p">(</span><span class="n">item</span><span class="p">.</span><span class="na">getAge</span><span class="p">()));</span>
<a id="__codelineno-10-215" name="__codelineno-10-215"></a><span class="w">        </span><span class="n">row_new</span><span class="p">.</span><span class="na">createCell</span><span class="p">(</span><span class="mi">5</span><span class="p">).</span><span class="na">setCellValue</span><span class="p">(</span><span class="n">NullValue</span><span class="p">(</span><span class="n">item</span><span class="p">.</span><span class="na">getDept</span><span class="p">()));</span>
<a id="__codelineno-10-216" name="__codelineno-10-216"></a><span class="w">      </span><span class="p">}</span>
<a id="__codelineno-10-217" name="__codelineno-10-217"></a><span class="w">      </span><span class="n">wb</span><span class="p">.</span><span class="na">write</span><span class="p">(</span><span class="n">output</span><span class="p">);</span>
<a id="__codelineno-10-218" name="__codelineno-10-218"></a><span class="w">      </span><span class="c1">//wb.close();</span>
<a id="__codelineno-10-219" name="__codelineno-10-219"></a><span class="w">    </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-220" name="__codelineno-10-220"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setErr</span><span class="p">(</span><span class="n">ErrEnum</span><span class="p">.</span><span class="na">EXPORT_EXCEL_FAIL</span><span class="p">);</span>
<a id="__codelineno-10-221" name="__codelineno-10-221"></a><span class="w">      </span><span class="n">oc</span><span class="p">.</span><span class="na">setDetail</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-10-222" name="__codelineno-10-222"></a><span class="w">      </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-10-223" name="__codelineno-10-223"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-10-224" name="__codelineno-10-224"></a>
<a id="__codelineno-10-225" name="__codelineno-10-225"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-10-226" name="__codelineno-10-226"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-227" name="__codelineno-10-227"></a>
<a id="__codelineno-10-228" name="__codelineno-10-228"></a><span class="w">  </span><span class="kd">private</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="nf">NullValue</span><span class="p">(</span><span class="n">Object</span><span class="w"> </span><span class="n">o</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-10-229" name="__codelineno-10-229"></a><span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="kc">null</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="o">?</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">o</span><span class="p">.</span><span class="na">toString</span><span class="p">();</span>
<a id="__codelineno-10-230" name="__codelineno-10-230"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-10-231" name="__codelineno-10-231"></a><span class="p">}</span>
</code></pre></div></td></tr></table></div>
</li>
<li>
<p>创建<code>StudentController</code>，实现学生表CRUD操作Web Api，参考代码如下：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/src/main/java/xust/stu/demo/controller/StudentController.java</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-11-1">  1</a></span>
<span class="normal"><a href="#__codelineno-11-2">  2</a></span>
<span class="normal"><a href="#__codelineno-11-3">  3</a></span>
<span class="normal"><a href="#__codelineno-11-4">  4</a></span>
<span class="normal"><a href="#__codelineno-11-5">  5</a></span>
<span class="normal"><a href="#__codelineno-11-6">  6</a></span>
<span class="normal"><a href="#__codelineno-11-7">  7</a></span>
<span class="normal"><a href="#__codelineno-11-8">  8</a></span>
<span class="normal"><a href="#__codelineno-11-9">  9</a></span>
<span class="normal"><a href="#__codelineno-11-10"> 10</a></span>
<span class="normal"><a href="#__codelineno-11-11"> 11</a></span>
<span class="normal"><a href="#__codelineno-11-12"> 12</a></span>
<span class="normal"><a href="#__codelineno-11-13"> 13</a></span>
<span class="normal"><a href="#__codelineno-11-14"> 14</a></span>
<span class="normal"><a href="#__codelineno-11-15"> 15</a></span>
<span class="normal"><a href="#__codelineno-11-16"> 16</a></span>
<span class="normal"><a href="#__codelineno-11-17"> 17</a></span>
<span class="normal"><a href="#__codelineno-11-18"> 18</a></span>
<span class="normal"><a href="#__codelineno-11-19"> 19</a></span>
<span class="normal"><a href="#__codelineno-11-20"> 20</a></span>
<span class="normal"><a href="#__codelineno-11-21"> 21</a></span>
<span class="normal"><a href="#__codelineno-11-22"> 22</a></span>
<span class="normal"><a href="#__codelineno-11-23"> 23</a></span>
<span class="normal"><a href="#__codelineno-11-24"> 24</a></span>
<span class="normal"><a href="#__codelineno-11-25"> 25</a></span>
<span class="normal"><a href="#__codelineno-11-26"> 26</a></span>
<span class="normal"><a href="#__codelineno-11-27"> 27</a></span>
<span class="normal"><a href="#__codelineno-11-28"> 28</a></span>
<span class="normal"><a href="#__codelineno-11-29"> 29</a></span>
<span class="normal"><a href="#__codelineno-11-30"> 30</a></span>
<span class="normal"><a href="#__codelineno-11-31"> 31</a></span>
<span class="normal"><a href="#__codelineno-11-32"> 32</a></span>
<span class="normal"><a href="#__codelineno-11-33"> 33</a></span>
<span class="normal"><a href="#__codelineno-11-34"> 34</a></span>
<span class="normal"><a href="#__codelineno-11-35"> 35</a></span>
<span class="normal"><a href="#__codelineno-11-36"> 36</a></span>
<span class="normal"><a href="#__codelineno-11-37"> 37</a></span>
<span class="normal"><a href="#__codelineno-11-38"> 38</a></span>
<span class="normal"><a href="#__codelineno-11-39"> 39</a></span>
<span class="normal"><a href="#__codelineno-11-40"> 40</a></span>
<span class="normal"><a href="#__codelineno-11-41"> 41</a></span>
<span class="normal"><a href="#__codelineno-11-42"> 42</a></span>
<span class="normal"><a href="#__codelineno-11-43"> 43</a></span>
<span class="normal"><a href="#__codelineno-11-44"> 44</a></span>
<span class="normal"><a href="#__codelineno-11-45"> 45</a></span>
<span class="normal"><a href="#__codelineno-11-46"> 46</a></span>
<span class="normal"><a href="#__codelineno-11-47"> 47</a></span>
<span class="normal"><a href="#__codelineno-11-48"> 48</a></span>
<span class="normal"><a href="#__codelineno-11-49"> 49</a></span>
<span class="normal"><a href="#__codelineno-11-50"> 50</a></span>
<span class="normal"><a href="#__codelineno-11-51"> 51</a></span>
<span class="normal"><a href="#__codelineno-11-52"> 52</a></span>
<span class="normal"><a href="#__codelineno-11-53"> 53</a></span>
<span class="normal"><a href="#__codelineno-11-54"> 54</a></span>
<span class="normal"><a href="#__codelineno-11-55"> 55</a></span>
<span class="normal"><a href="#__codelineno-11-56"> 56</a></span>
<span class="normal"><a href="#__codelineno-11-57"> 57</a></span>
<span class="normal"><a href="#__codelineno-11-58"> 58</a></span>
<span class="normal"><a href="#__codelineno-11-59"> 59</a></span>
<span class="normal"><a href="#__codelineno-11-60"> 60</a></span>
<span class="normal"><a href="#__codelineno-11-61"> 61</a></span>
<span class="normal"><a href="#__codelineno-11-62"> 62</a></span>
<span class="normal"><a href="#__codelineno-11-63"> 63</a></span>
<span class="normal"><a href="#__codelineno-11-64"> 64</a></span>
<span class="normal"><a href="#__codelineno-11-65"> 65</a></span>
<span class="normal"><a href="#__codelineno-11-66"> 66</a></span>
<span class="normal"><a href="#__codelineno-11-67"> 67</a></span>
<span class="normal"><a href="#__codelineno-11-68"> 68</a></span>
<span class="normal"><a href="#__codelineno-11-69"> 69</a></span>
<span class="normal"><a href="#__codelineno-11-70"> 70</a></span>
<span class="normal"><a href="#__codelineno-11-71"> 71</a></span>
<span class="normal"><a href="#__codelineno-11-72"> 72</a></span>
<span class="normal"><a href="#__codelineno-11-73"> 73</a></span>
<span class="normal"><a href="#__codelineno-11-74"> 74</a></span>
<span class="normal"><a href="#__codelineno-11-75"> 75</a></span>
<span class="normal"><a href="#__codelineno-11-76"> 76</a></span>
<span class="normal"><a href="#__codelineno-11-77"> 77</a></span>
<span class="normal"><a href="#__codelineno-11-78"> 78</a></span>
<span class="normal"><a href="#__codelineno-11-79"> 79</a></span>
<span class="normal"><a href="#__codelineno-11-80"> 80</a></span>
<span class="normal"><a href="#__codelineno-11-81"> 81</a></span>
<span class="normal"><a href="#__codelineno-11-82"> 82</a></span>
<span class="normal"><a href="#__codelineno-11-83"> 83</a></span>
<span class="normal"><a href="#__codelineno-11-84"> 84</a></span>
<span class="normal"><a href="#__codelineno-11-85"> 85</a></span>
<span class="normal"><a href="#__codelineno-11-86"> 86</a></span>
<span class="normal"><a href="#__codelineno-11-87"> 87</a></span>
<span class="normal"><a href="#__codelineno-11-88"> 88</a></span>
<span class="normal"><a href="#__codelineno-11-89"> 89</a></span>
<span class="normal"><a href="#__codelineno-11-90"> 90</a></span>
<span class="normal"><a href="#__codelineno-11-91"> 91</a></span>
<span class="normal"><a href="#__codelineno-11-92"> 92</a></span>
<span class="normal"><a href="#__codelineno-11-93"> 93</a></span>
<span class="normal"><a href="#__codelineno-11-94"> 94</a></span>
<span class="normal"><a href="#__codelineno-11-95"> 95</a></span>
<span class="normal"><a href="#__codelineno-11-96"> 96</a></span>
<span class="normal"><a href="#__codelineno-11-97"> 97</a></span>
<span class="normal"><a href="#__codelineno-11-98"> 98</a></span>
<span class="normal"><a href="#__codelineno-11-99"> 99</a></span>
<span class="normal"><a href="#__codelineno-11-100">100</a></span>
<span class="normal"><a href="#__codelineno-11-101">101</a></span>
<span class="normal"><a href="#__codelineno-11-102">102</a></span>
<span class="normal"><a href="#__codelineno-11-103">103</a></span>
<span class="normal"><a href="#__codelineno-11-104">104</a></span>
<span class="normal"><a href="#__codelineno-11-105">105</a></span>
<span class="normal"><a href="#__codelineno-11-106">106</a></span>
<span class="normal"><a href="#__codelineno-11-107">107</a></span>
<span class="normal"><a href="#__codelineno-11-108">108</a></span>
<span class="normal"><a href="#__codelineno-11-109">109</a></span>
<span class="normal"><a href="#__codelineno-11-110">110</a></span>
<span class="normal"><a href="#__codelineno-11-111">111</a></span>
<span class="normal"><a href="#__codelineno-11-112">112</a></span>
<span class="normal"><a href="#__codelineno-11-113">113</a></span>
<span class="normal"><a href="#__codelineno-11-114">114</a></span>
<span class="normal"><a href="#__codelineno-11-115">115</a></span>
<span class="normal"><a href="#__codelineno-11-116">116</a></span>
<span class="normal"><a href="#__codelineno-11-117">117</a></span>
<span class="normal"><a href="#__codelineno-11-118">118</a></span>
<span class="normal"><a href="#__codelineno-11-119">119</a></span>
<span class="normal"><a href="#__codelineno-11-120">120</a></span>
<span class="normal"><a href="#__codelineno-11-121">121</a></span>
<span class="normal"><a href="#__codelineno-11-122">122</a></span>
<span class="normal"><a href="#__codelineno-11-123">123</a></span>
<span class="normal"><a href="#__codelineno-11-124">124</a></span>
<span class="normal"><a href="#__codelineno-11-125">125</a></span>
<span class="normal"><a href="#__codelineno-11-126">126</a></span>
<span class="normal"><a href="#__codelineno-11-127">127</a></span>
<span class="normal"><a href="#__codelineno-11-128">128</a></span>
<span class="normal"><a href="#__codelineno-11-129">129</a></span>
<span class="normal"><a href="#__codelineno-11-130">130</a></span>
<span class="normal"><a href="#__codelineno-11-131">131</a></span>
<span class="normal"><a href="#__codelineno-11-132">132</a></span>
<span class="normal"><a href="#__codelineno-11-133">133</a></span>
<span class="normal"><a href="#__codelineno-11-134">134</a></span>
<span class="normal"><a href="#__codelineno-11-135">135</a></span>
<span class="normal"><a href="#__codelineno-11-136">136</a></span>
<span class="normal"><a href="#__codelineno-11-137">137</a></span>
<span class="normal"><a href="#__codelineno-11-138">138</a></span>
<span class="normal"><a href="#__codelineno-11-139">139</a></span>
<span class="normal"><a href="#__codelineno-11-140">140</a></span>
<span class="normal"><a href="#__codelineno-11-141">141</a></span>
<span class="normal"><a href="#__codelineno-11-142">142</a></span>
<span class="normal"><a href="#__codelineno-11-143">143</a></span>
<span class="normal"><a href="#__codelineno-11-144">144</a></span>
<span class="normal"><a href="#__codelineno-11-145">145</a></span>
<span class="normal"><a href="#__codelineno-11-146">146</a></span>
<span class="normal"><a href="#__codelineno-11-147">147</a></span>
<span class="normal"><a href="#__codelineno-11-148">148</a></span>
<span class="normal"><a href="#__codelineno-11-149">149</a></span>
<span class="normal"><a href="#__codelineno-11-150">150</a></span>
<span class="normal"><a href="#__codelineno-11-151">151</a></span>
<span class="normal"><a href="#__codelineno-11-152">152</a></span>
<span class="normal"><a href="#__codelineno-11-153">153</a></span>
<span class="normal"><a href="#__codelineno-11-154">154</a></span>
<span class="normal"><a href="#__codelineno-11-155">155</a></span>
<span class="normal"><a href="#__codelineno-11-156">156</a></span>
<span class="normal"><a href="#__codelineno-11-157">157</a></span>
<span class="normal"><a href="#__codelineno-11-158">158</a></span>
<span class="normal"><a href="#__codelineno-11-159">159</a></span>
<span class="normal"><a href="#__codelineno-11-160">160</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1"></a><span class="cm">/*</span>
<a id="__codelineno-11-2" name="__codelineno-11-2"></a><span class="cm"> * File name : StudentController.java 2023-04-20</span>
<a id="__codelineno-11-3" name="__codelineno-11-3"></a><span class="cm"> * Copyright 2023 XUST. All rights reserved.</span>
<a id="__codelineno-11-4" name="__codelineno-11-4"></a><span class="cm"> */</span>
<a id="__codelineno-11-5" name="__codelineno-11-5"></a><span class="kn">package</span><span class="w"> </span><span class="nn">xust.stu.demo.controller</span><span class="p">;</span>
<a id="__codelineno-11-6" name="__codelineno-11-6"></a>
<a id="__codelineno-11-7" name="__codelineno-11-7"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.HashMap</span><span class="p">;</span>
<a id="__codelineno-11-8" name="__codelineno-11-8"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.Map</span><span class="p">;</span>
<a id="__codelineno-11-9" name="__codelineno-11-9"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.io.OutputStream</span><span class="p">;</span>
<a id="__codelineno-11-10" name="__codelineno-11-10"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.ArrayList</span><span class="p">;</span>
<a id="__codelineno-11-11" name="__codelineno-11-11"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.net.URLEncoder</span><span class="p">;</span>
<a id="__codelineno-11-12" name="__codelineno-11-12"></a><span class="kn">import</span><span class="w"> </span><span class="nn">jakarta.servlet.http.HttpServletResponse</span><span class="p">;</span>
<a id="__codelineno-11-13" name="__codelineno-11-13"></a>
<a id="__codelineno-11-14" name="__codelineno-11-14"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.slf4j.Logger</span><span class="p">;</span>
<a id="__codelineno-11-15" name="__codelineno-11-15"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.slf4j.LoggerFactory</span><span class="p">;</span>
<a id="__codelineno-11-16" name="__codelineno-11-16"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.beans.factory.annotation.Autowired</span><span class="p">;</span>
<a id="__codelineno-11-17" name="__codelineno-11-17"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.web.bind.annotation.RequestBody</span><span class="p">;</span>
<a id="__codelineno-11-18" name="__codelineno-11-18"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.web.bind.annotation.PostMapping</span><span class="p">;</span>
<a id="__codelineno-11-19" name="__codelineno-11-19"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.web.bind.annotation.RequestMapping</span><span class="p">;</span>
<a id="__codelineno-11-20" name="__codelineno-11-20"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.web.bind.annotation.RequestParam</span><span class="p">;</span>
<a id="__codelineno-11-21" name="__codelineno-11-21"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.web.bind.annotation.RestController</span><span class="p">;</span>
<a id="__codelineno-11-22" name="__codelineno-11-22"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.web.servlet.ModelAndView</span><span class="p">;</span>
<a id="__codelineno-11-23" name="__codelineno-11-23"></a>
<a id="__codelineno-11-24" name="__codelineno-11-24"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.List</span><span class="p">;</span>
<a id="__codelineno-11-25" name="__codelineno-11-25"></a><span class="kn">import</span><span class="w"> </span><span class="nn">org.springframework.validation.annotation.Validated</span><span class="p">;</span>
<a id="__codelineno-11-26" name="__codelineno-11-26"></a>
<a id="__codelineno-11-27" name="__codelineno-11-27"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.Result</span><span class="p">;</span>
<a id="__codelineno-11-28" name="__codelineno-11-28"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.Result4GetPage</span><span class="p">;</span>
<a id="__codelineno-11-29" name="__codelineno-11-29"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.domain.DeleteItems4Student</span><span class="p">;</span>
<a id="__codelineno-11-30" name="__codelineno-11-30"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.domain.GetPage4Student</span><span class="p">;</span>
<a id="__codelineno-11-31" name="__codelineno-11-31"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.domain.Student</span><span class="p">;</span>
<a id="__codelineno-11-32" name="__codelineno-11-32"></a><span class="kn">import</span><span class="w"> </span><span class="nn">xust.stu.demo.service.StudentServiceImpl</span><span class="p">;</span>
<a id="__codelineno-11-33" name="__codelineno-11-33"></a>
<a id="__codelineno-11-34" name="__codelineno-11-34"></a><span class="kn">import</span><span class="w"> </span><span class="nn">java.util.TreeMap</span><span class="p">;</span>
<a id="__codelineno-11-35" name="__codelineno-11-35"></a>
<a id="__codelineno-11-36" name="__codelineno-11-36"></a><span class="cm">/**</span>
<a id="__codelineno-11-37" name="__codelineno-11-37"></a><span class="cm"> * Class StudentController</span>
<a id="__codelineno-11-38" name="__codelineno-11-38"></a><span class="cm"> * Student action class.</span>
<a id="__codelineno-11-39" name="__codelineno-11-39"></a><span class="cm"> * @generated May 28, 2023, 9:37:49 AM</span>
<a id="__codelineno-11-40" name="__codelineno-11-40"></a><span class="cm"> * @author XUST</span>
<a id="__codelineno-11-41" name="__codelineno-11-41"></a><span class="cm"> * @version 1.0, 2023-04-20</span>
<a id="__codelineno-11-42" name="__codelineno-11-42"></a><span class="cm"> */</span>
<a id="__codelineno-11-43" name="__codelineno-11-43"></a><span class="nd">@RestController</span>
<a id="__codelineno-11-44" name="__codelineno-11-44"></a><span class="nd">@RequestMapping</span><span class="p">(</span><span class="s">&quot;/demo/Student&quot;</span><span class="p">)</span>
<a id="__codelineno-11-45" name="__codelineno-11-45"></a><span class="kd">public</span><span class="w"> </span><span class="kd">class</span> <span class="nc">StudentController</span><span class="p">{</span>
<a id="__codelineno-11-46" name="__codelineno-11-46"></a><span class="w">  </span><span class="kd">private</span><span class="w"> </span><span class="kd">final</span><span class="w"> </span><span class="kd">static</span><span class="w"> </span><span class="n">Logger</span><span class="w"> </span><span class="n">log</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">LoggerFactory</span><span class="p">.</span><span class="na">getLogger</span><span class="p">(</span><span class="n">StudentController</span><span class="p">.</span><span class="na">class</span><span class="p">);</span>
<a id="__codelineno-11-47" name="__codelineno-11-47"></a>
<a id="__codelineno-11-48" name="__codelineno-11-48"></a><span class="w">  </span><span class="nd">@Autowired</span>
<a id="__codelineno-11-49" name="__codelineno-11-49"></a><span class="w">  </span><span class="kd">private</span><span class="w"> </span><span class="n">StudentServiceImpl</span><span class="w"> </span><span class="n">studentService</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">null</span><span class="p">;</span>
<a id="__codelineno-11-50" name="__codelineno-11-50"></a>
<a id="__codelineno-11-51" name="__codelineno-11-51"></a><span class="w">    </span><span class="nd">@RequestMapping</span><span class="p">(</span><span class="n">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;/list-jquery&quot;</span><span class="p">)</span>
<a id="__codelineno-11-52" name="__codelineno-11-52"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">ModelAndView</span><span class="w"> </span><span class="nf">doListJquery</span><span class="p">(){</span>
<a id="__codelineno-11-53" name="__codelineno-11-53"></a><span class="w">        </span><span class="n">ModelAndView</span><span class="w"> </span><span class="n">mv</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">ModelAndView</span><span class="p">(</span><span class="s">&quot;/demo/Student/list-jquery&quot;</span><span class="p">);</span>
<a id="__codelineno-11-54" name="__codelineno-11-54"></a>
<a id="__codelineno-11-55" name="__codelineno-11-55"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">mv</span><span class="p">;</span>
<a id="__codelineno-11-56" name="__codelineno-11-56"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-57" name="__codelineno-11-57"></a><span class="w">    </span><span class="nd">@RequestMapping</span><span class="p">(</span><span class="n">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;/list-bootstrap&quot;</span><span class="p">)</span>
<a id="__codelineno-11-58" name="__codelineno-11-58"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">ModelAndView</span><span class="w"> </span><span class="nf">doListBootstrap</span><span class="p">(){</span>
<a id="__codelineno-11-59" name="__codelineno-11-59"></a><span class="w">        </span><span class="n">ModelAndView</span><span class="w"> </span><span class="n">mv</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">ModelAndView</span><span class="p">(</span><span class="s">&quot;/demo/Student/list-bootstrap&quot;</span><span class="p">);</span>
<a id="__codelineno-11-60" name="__codelineno-11-60"></a>
<a id="__codelineno-11-61" name="__codelineno-11-61"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">mv</span><span class="p">;</span>
<a id="__codelineno-11-62" name="__codelineno-11-62"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-63" name="__codelineno-11-63"></a>
<a id="__codelineno-11-64" name="__codelineno-11-64"></a><span class="w">    </span><span class="nd">@PostMapping</span><span class="p">(</span><span class="n">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;/add&quot;</span><span class="p">)</span>
<a id="__codelineno-11-65" name="__codelineno-11-65"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">doAdd</span><span class="p">(</span><span class="nd">@RequestBody</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">true</span><span class="p">)</span><span class="w"> </span><span class="nd">@Validated</span><span class="w"> </span><span class="n">Student</span><span class="w"> </span><span class="n">o</span><span class="p">){</span>
<a id="__codelineno-11-66" name="__codelineno-11-66"></a><span class="w">        </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">create</span><span class="p">(</span><span class="n">o</span><span class="p">);</span>
<a id="__codelineno-11-67" name="__codelineno-11-67"></a>
<a id="__codelineno-11-68" name="__codelineno-11-68"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-11-69" name="__codelineno-11-69"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-70" name="__codelineno-11-70"></a>
<a id="__codelineno-11-71" name="__codelineno-11-71"></a><span class="w">    </span><span class="nd">@PostMapping</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;/delete&quot;</span><span class="p">)</span>
<a id="__codelineno-11-72" name="__codelineno-11-72"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">doDelete</span><span class="p">(</span><span class="nd">@RequestBody</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">true</span><span class="p">)</span><span class="w"> </span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="w"> </span><span class="n">ids</span><span class="p">){</span>
<a id="__codelineno-11-73" name="__codelineno-11-73"></a><span class="w">        </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">deleteItems</span><span class="p">(</span><span class="n">ids</span><span class="p">);</span>
<a id="__codelineno-11-74" name="__codelineno-11-74"></a>
<a id="__codelineno-11-75" name="__codelineno-11-75"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-11-76" name="__codelineno-11-76"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-77" name="__codelineno-11-77"></a>
<a id="__codelineno-11-78" name="__codelineno-11-78"></a><span class="w">    </span><span class="nd">@PostMapping</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;/update&quot;</span><span class="p">)</span>
<a id="__codelineno-11-79" name="__codelineno-11-79"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="nf">doUpdate</span><span class="p">(</span><span class="nd">@RequestBody</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">true</span><span class="p">)</span><span class="w"> </span><span class="nd">@Validated</span><span class="w"> </span><span class="n">Student</span><span class="w"> </span><span class="n">o</span><span class="p">){</span>
<a id="__codelineno-11-80" name="__codelineno-11-80"></a><span class="w">        </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">update</span><span class="p">(</span><span class="n">o</span><span class="p">);</span>
<a id="__codelineno-11-81" name="__codelineno-11-81"></a>
<a id="__codelineno-11-82" name="__codelineno-11-82"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">oc</span><span class="p">;</span>
<a id="__codelineno-11-83" name="__codelineno-11-83"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-84" name="__codelineno-11-84"></a>
<a id="__codelineno-11-85" name="__codelineno-11-85"></a><span class="w">    </span><span class="nd">@PostMapping</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;/getPage&quot;</span><span class="p">)</span>
<a id="__codelineno-11-86" name="__codelineno-11-86"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Result4GetPage</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;&gt;</span><span class="w"> </span><span class="nf">doGetPage</span><span class="p">(</span><span class="nd">@RequestBody</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">true</span><span class="p">)</span><span class="w"> </span><span class="nd">@Validated</span><span class="w"> </span><span class="n">GetPage4Student</span><span class="w"> </span><span class="n">p</span><span class="p">){</span>
<a id="__codelineno-11-87" name="__codelineno-11-87"></a><span class="w">        </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Result4GetPage</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;&gt;</span><span class="w"> </span><span class="n">res</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Result4GetPage</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;&gt;</span><span class="p">();</span>
<a id="__codelineno-11-88" name="__codelineno-11-88"></a>
<a id="__codelineno-11-89" name="__codelineno-11-89"></a><span class="w">        </span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-11-90" name="__codelineno-11-90"></a><span class="w">        </span><span class="n">params</span><span class="p">.</span><span class="na">put</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="na">getId</span><span class="p">());</span>
<a id="__codelineno-11-91" name="__codelineno-11-91"></a><span class="w">        </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc_size</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">size</span><span class="p">(</span><span class="n">params</span><span class="p">);</span>
<a id="__codelineno-11-92" name="__codelineno-11-92"></a><span class="w">        </span><span class="k">if</span><span class="p">(</span><span class="n">oc_size</span><span class="p">.</span><span class="na">getCode</span><span class="p">()</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">){</span>
<a id="__codelineno-11-93" name="__codelineno-11-93"></a><span class="w">            </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">oc_getPage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">getPage</span><span class="p">(</span><span class="n">params</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="na">getPageNum</span><span class="p">(),</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="na">getPageSize</span><span class="p">());</span>
<a id="__codelineno-11-94" name="__codelineno-11-94"></a><span class="w">            </span><span class="k">if</span><span class="p">(</span><span class="n">oc_getPage</span><span class="p">.</span><span class="na">getCode</span><span class="p">()</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">){</span>
<a id="__codelineno-11-95" name="__codelineno-11-95"></a><span class="w">                </span><span class="n">Result4GetPage</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">Result4GetPage</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="p">();</span>
<a id="__codelineno-11-96" name="__codelineno-11-96"></a><span class="w">                </span><span class="n">result</span><span class="p">.</span><span class="na">setTotal</span><span class="p">(</span><span class="n">oc_size</span><span class="p">.</span><span class="na">getData</span><span class="p">());</span>
<a id="__codelineno-11-97" name="__codelineno-11-97"></a><span class="w">                </span><span class="n">result</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">oc_getPage</span><span class="p">.</span><span class="na">getData</span><span class="p">());</span>
<a id="__codelineno-11-98" name="__codelineno-11-98"></a><span class="w">                </span><span class="n">res</span><span class="p">.</span><span class="na">setData</span><span class="p">(</span><span class="n">result</span><span class="p">);</span>
<a id="__codelineno-11-99" name="__codelineno-11-99"></a><span class="w">            </span><span class="p">}</span><span class="k">else</span><span class="p">{</span>
<a id="__codelineno-11-100" name="__codelineno-11-100"></a><span class="w">                </span><span class="n">res</span><span class="p">.</span><span class="na">setCode</span><span class="p">(</span><span class="n">oc_getPage</span><span class="p">.</span><span class="na">getCode</span><span class="p">());</span>
<a id="__codelineno-11-101" name="__codelineno-11-101"></a><span class="w">                </span><span class="n">res</span><span class="p">.</span><span class="na">setMessage</span><span class="p">(</span><span class="n">oc_getPage</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-11-102" name="__codelineno-11-102"></a><span class="w">            </span><span class="p">}</span>
<a id="__codelineno-11-103" name="__codelineno-11-103"></a><span class="w">        </span><span class="p">}</span><span class="k">else</span><span class="p">{</span>
<a id="__codelineno-11-104" name="__codelineno-11-104"></a><span class="w">            </span><span class="n">res</span><span class="p">.</span><span class="na">setCode</span><span class="p">(</span><span class="n">oc_size</span><span class="p">.</span><span class="na">getCode</span><span class="p">());</span>
<a id="__codelineno-11-105" name="__codelineno-11-105"></a><span class="w">            </span><span class="n">res</span><span class="p">.</span><span class="na">setMessage</span><span class="p">(</span><span class="n">oc_size</span><span class="p">.</span><span class="na">getMessage</span><span class="p">());</span>
<a id="__codelineno-11-106" name="__codelineno-11-106"></a><span class="w">        </span><span class="p">}</span>
<a id="__codelineno-11-107" name="__codelineno-11-107"></a>
<a id="__codelineno-11-108" name="__codelineno-11-108"></a><span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">res</span><span class="p">;</span>
<a id="__codelineno-11-109" name="__codelineno-11-109"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-110" name="__codelineno-11-110"></a>
<a id="__codelineno-11-111" name="__codelineno-11-111"></a><span class="w">    </span><span class="nd">@PostMapping</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;/template&quot;</span><span class="p">)</span>
<a id="__codelineno-11-112" name="__codelineno-11-112"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">doTemplate</span><span class="p">(</span><span class="n">HttpServletResponse</span><span class="w"> </span><span class="n">response</span><span class="p">){</span>
<a id="__codelineno-11-113" name="__codelineno-11-113"></a><span class="w">        </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-114" name="__codelineno-11-114"></a><span class="w">            </span><span class="n">String</span><span class="w"> </span><span class="n">file_name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;学生表.xls&quot;</span><span class="p">;</span>
<a id="__codelineno-11-115" name="__codelineno-11-115"></a><span class="w">            </span><span class="n">response</span><span class="p">.</span><span class="na">setContentType</span><span class="p">(</span><span class="s">&quot;application/vnd.ms-excel;charset=utf-8&quot;</span><span class="p">);</span>
<a id="__codelineno-11-116" name="__codelineno-11-116"></a><span class="w">            </span><span class="n">response</span><span class="p">.</span><span class="na">setHeader</span><span class="p">(</span><span class="s">&quot;Content-disposition&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;attachment;filename=&quot;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">file_name</span><span class="p">);</span>
<a id="__codelineno-11-117" name="__codelineno-11-117"></a><span class="w">            </span><span class="n">response</span><span class="p">.</span><span class="na">flushBuffer</span><span class="p">();</span>
<a id="__codelineno-11-118" name="__codelineno-11-118"></a><span class="w">            </span><span class="n">OutputStream</span><span class="w"> </span><span class="n">outputStream</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">response</span><span class="p">.</span><span class="na">getOutputStream</span><span class="p">();</span>
<a id="__codelineno-11-119" name="__codelineno-11-119"></a><span class="w">            </span><span class="n">studentService</span><span class="p">.</span><span class="na">buildXLSTemplate</span><span class="p">(</span><span class="s">&quot;学生表&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;学生表&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">outputStream</span><span class="p">);</span>
<a id="__codelineno-11-120" name="__codelineno-11-120"></a><span class="w">            </span><span class="n">outputStream</span><span class="p">.</span><span class="na">flush</span><span class="p">();</span>
<a id="__codelineno-11-121" name="__codelineno-11-121"></a><span class="w">            </span><span class="n">outputStream</span><span class="p">.</span><span class="na">close</span><span class="p">();</span>
<a id="__codelineno-11-122" name="__codelineno-11-122"></a><span class="w">        </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-123" name="__codelineno-11-123"></a><span class="w">            </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="na">getLocalizedMessage</span><span class="p">());</span>
<a id="__codelineno-11-124" name="__codelineno-11-124"></a><span class="w">        </span><span class="p">}</span>
<a id="__codelineno-11-125" name="__codelineno-11-125"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-126" name="__codelineno-11-126"></a>
<a id="__codelineno-11-127" name="__codelineno-11-127"></a><span class="w">    </span><span class="nd">@PostMapping</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;/toExcel&quot;</span><span class="p">)</span>
<a id="__codelineno-11-128" name="__codelineno-11-128"></a><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">doToExcel</span><span class="p">(</span><span class="n">HttpServletResponse</span><span class="w"> </span><span class="n">response</span><span class="p">,</span><span class="w"> </span><span class="nd">@RequestBody</span><span class="p">(</span><span class="n">required</span><span class="o">=</span><span class="kc">true</span><span class="p">)</span><span class="w"> </span><span class="nd">@Validated</span><span class="w"> </span><span class="n">GetPage4Student</span><span class="w"> </span><span class="n">p</span><span class="p">){</span>
<a id="__codelineno-11-129" name="__codelineno-11-129"></a><span class="w">        </span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="w"> </span><span class="n">params</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="p">,</span><span class="w"> </span><span class="n">Object</span><span class="o">&gt;</span><span class="p">();</span>
<a id="__codelineno-11-130" name="__codelineno-11-130"></a><span class="w">        </span><span class="n">params</span><span class="p">.</span><span class="na">put</span><span class="p">(</span><span class="s">&quot;id&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="na">getId</span><span class="p">());</span>
<a id="__codelineno-11-131" name="__codelineno-11-131"></a><span class="w">        </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="n">oc_size</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">size</span><span class="p">(</span><span class="n">params</span><span class="p">);</span>
<a id="__codelineno-11-132" name="__codelineno-11-132"></a><span class="w">        </span><span class="n">String</span><span class="w"> </span><span class="n">title</span><span class="o">=</span><span class="s">&quot;学生表&quot;</span><span class="p">;</span>
<a id="__codelineno-11-133" name="__codelineno-11-133"></a><span class="w">        </span><span class="n">OutputStream</span><span class="w"> </span><span class="n">outputStream</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">null</span><span class="p">;</span>
<a id="__codelineno-11-134" name="__codelineno-11-134"></a><span class="w">        </span><span class="k">if</span><span class="p">(</span><span class="n">oc_size</span><span class="p">.</span><span class="na">getCode</span><span class="p">()</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">){</span><span class="w">     </span>
<a id="__codelineno-11-135" name="__codelineno-11-135"></a><span class="w">            </span><span class="n">Result</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">Student</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">oc_getPage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">studentService</span><span class="p">.</span><span class="na">getPage</span><span class="p">(</span><span class="n">params</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">2000</span><span class="p">);</span>
<a id="__codelineno-11-136" name="__codelineno-11-136"></a><span class="w">            </span><span class="k">if</span><span class="p">(</span><span class="n">oc_getPage</span><span class="p">.</span><span class="na">getCode</span><span class="p">()</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">){</span>
<a id="__codelineno-11-137" name="__codelineno-11-137"></a><span class="w">        </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-138" name="__codelineno-11-138"></a><span class="w">          </span><span class="n">outputStream</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">response</span><span class="p">.</span><span class="na">getOutputStream</span><span class="p">();</span>
<a id="__codelineno-11-139" name="__codelineno-11-139"></a><span class="w">          </span><span class="n">response</span><span class="p">.</span><span class="na">setContentType</span><span class="p">(</span><span class="s">&quot;application/vnd.ms-excel;charset=utf-8&quot;</span><span class="p">);</span>
<a id="__codelineno-11-140" name="__codelineno-11-140"></a><span class="w">          </span><span class="n">String</span><span class="w"> </span><span class="n">fileName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">URLEncoder</span><span class="p">.</span><span class="na">encode</span><span class="p">(</span><span class="n">title</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s">&quot;.xls&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;UTF-8&quot;</span><span class="p">);</span>
<a id="__codelineno-11-141" name="__codelineno-11-141"></a><span class="w">          </span><span class="n">response</span><span class="p">.</span><span class="na">setHeader</span><span class="p">(</span><span class="s">&quot;Content-disposition&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;attachment;filename=&quot;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">fileName</span><span class="p">);</span>
<a id="__codelineno-11-142" name="__codelineno-11-142"></a><span class="w">          </span><span class="n">response</span><span class="p">.</span><span class="na">flushBuffer</span><span class="p">();</span>
<a id="__codelineno-11-143" name="__codelineno-11-143"></a><span class="w">          </span><span class="n">studentService</span><span class="p">.</span><span class="na">export2XLS</span><span class="p">(</span><span class="n">oc_getPage</span><span class="p">.</span><span class="na">getData</span><span class="p">(),</span><span class="w"> </span><span class="n">title</span><span class="p">,</span><span class="w"> </span><span class="n">title</span><span class="p">,</span><span class="w"> </span><span class="n">outputStream</span><span class="p">);</span>
<a id="__codelineno-11-144" name="__codelineno-11-144"></a><span class="w">          </span><span class="n">outputStream</span><span class="p">.</span><span class="na">flush</span><span class="p">();</span>
<a id="__codelineno-11-145" name="__codelineno-11-145"></a><span class="w">          </span><span class="n">outputStream</span><span class="p">.</span><span class="na">close</span><span class="p">();</span>
<a id="__codelineno-11-146" name="__codelineno-11-146"></a><span class="w">        </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-147" name="__codelineno-11-147"></a><span class="w">          </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="s">&quot;导出Excel异常&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">e</span><span class="p">);</span>
<a id="__codelineno-11-148" name="__codelineno-11-148"></a><span class="w">        </span><span class="p">}</span><span class="k">finally</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-149" name="__codelineno-11-149"></a><span class="w">          </span><span class="k">try</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-150" name="__codelineno-11-150"></a><span class="w">            </span><span class="k">if</span><span class="p">(</span><span class="n">outputStream</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">null</span><span class="p">){</span>
<a id="__codelineno-11-151" name="__codelineno-11-151"></a><span class="w">              </span><span class="n">outputStream</span><span class="p">.</span><span class="na">close</span><span class="p">();</span>
<a id="__codelineno-11-152" name="__codelineno-11-152"></a><span class="w">            </span><span class="p">}</span>
<a id="__codelineno-11-153" name="__codelineno-11-153"></a><span class="w">          </span><span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="n">Exception</span><span class="w"> </span><span class="n">e1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-11-154" name="__codelineno-11-154"></a><span class="w">            </span><span class="n">log</span><span class="p">.</span><span class="na">error</span><span class="p">(</span><span class="s">&quot;导出Excel关闭异常&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">e1</span><span class="p">);</span>
<a id="__codelineno-11-155" name="__codelineno-11-155"></a><span class="w">          </span><span class="p">}</span>
<a id="__codelineno-11-156" name="__codelineno-11-156"></a><span class="w">        </span><span class="p">}</span>
<a id="__codelineno-11-157" name="__codelineno-11-157"></a><span class="w">            </span><span class="p">}</span>
<a id="__codelineno-11-158" name="__codelineno-11-158"></a><span class="w">        </span><span class="p">}</span>
<a id="__codelineno-11-159" name="__codelineno-11-159"></a><span class="w">    </span><span class="p">}</span>
<a id="__codelineno-11-160" name="__codelineno-11-160"></a><span class="p">}</span>
</code></pre></div></td></tr></table></div>
</li>
</ol>
<h3 id="_3">测试</h3>
<ol>
<li>
<p>在Spring Boot Dashbord启动Stu工程</p>
</li>
<li>
<p>使用<strong>REST Client</strong>编写学生表CRUD测试代码，参考代码如下：</p>
<div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">Stu/api_test.http</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-12-1"> 1</a></span>
<span class="normal"><a href="#__codelineno-12-2"> 2</a></span>
<span class="normal"><a href="#__codelineno-12-3"> 3</a></span>
<span class="normal"><a href="#__codelineno-12-4"> 4</a></span>
<span class="normal"><a href="#__codelineno-12-5"> 5</a></span>
<span class="normal"><a href="#__codelineno-12-6"> 6</a></span>
<span class="normal"><a href="#__codelineno-12-7"> 7</a></span>
<span class="normal"><a href="#__codelineno-12-8"> 8</a></span>
<span class="normal"><a href="#__codelineno-12-9"> 9</a></span>
<span class="normal"><a href="#__codelineno-12-10">10</a></span>
<span class="normal"><a href="#__codelineno-12-11">11</a></span>
<span class="normal"><a href="#__codelineno-12-12">12</a></span>
<span class="normal"><a href="#__codelineno-12-13">13</a></span>
<span class="normal"><a href="#__codelineno-12-14">14</a></span>
<span class="normal"><a href="#__codelineno-12-15">15</a></span>
<span class="normal"><a href="#__codelineno-12-16">16</a></span>
<span class="normal"><a href="#__codelineno-12-17">17</a></span>
<span class="normal"><a href="#__codelineno-12-18">18</a></span>
<span class="normal"><a href="#__codelineno-12-19">19</a></span>
<span class="normal"><a href="#__codelineno-12-20">20</a></span>
<span class="normal"><a href="#__codelineno-12-21">21</a></span>
<span class="normal"><a href="#__codelineno-12-22">22</a></span>
<span class="normal"><a href="#__codelineno-12-23">23</a></span>
<span class="normal"><a href="#__codelineno-12-24">24</a></span>
<span class="normal"><a href="#__codelineno-12-25">25</a></span>
<span class="normal"><a href="#__codelineno-12-26">26</a></span>
<span class="normal"><a href="#__codelineno-12-27">27</a></span>
<span class="normal"><a href="#__codelineno-12-28">28</a></span>
<span class="normal"><a href="#__codelineno-12-29">29</a></span>
<span class="normal"><a href="#__codelineno-12-30">30</a></span>
<span class="normal"><a href="#__codelineno-12-31">31</a></span>
<span class="normal"><a href="#__codelineno-12-32">32</a></span>
<span class="normal"><a href="#__codelineno-12-33">33</a></span>
<span class="normal"><a href="#__codelineno-12-34">34</a></span>
<span class="normal"><a href="#__codelineno-12-35">35</a></span>
<span class="normal"><a href="#__codelineno-12-36">36</a></span>
<span class="normal"><a href="#__codelineno-12-37">37</a></span>
<span class="normal"><a href="#__codelineno-12-38">38</a></span>
<span class="normal"><a href="#__codelineno-12-39">39</a></span>
<span class="normal"><a href="#__codelineno-12-40">40</a></span>
<span class="normal"><a href="#__codelineno-12-41">41</a></span></pre></div></td><td class="code"><div><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1"></a><span class="err">###</span>
<a id="__codelineno-12-2" name="__codelineno-12-2"></a><span class="nf">POST</span> <span class="nn">http://localhost:8080/demo/Student/add</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<a id="__codelineno-12-3" name="__codelineno-12-3"></a><span class="na">content-type</span><span class="o">:</span> <span class="l">application/json</span>
<a id="__codelineno-12-4" name="__codelineno-12-4"></a>
<a id="__codelineno-12-5" name="__codelineno-12-5"></a><span class="p">{</span>
<a id="__codelineno-12-6" name="__codelineno-12-6"></a><span class="w">  </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X100&quot;</span><span class="p">,</span>
<a id="__codelineno-12-7" name="__codelineno-12-7"></a><span class="w">  </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;99999&quot;</span><span class="p">,</span>
<a id="__codelineno-12-8" name="__codelineno-12-8"></a><span class="w">  </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X102&quot;</span><span class="p">,</span>
<a id="__codelineno-12-9" name="__codelineno-12-9"></a><span class="w">  </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X103&quot;</span><span class="p">,</span>
<a id="__codelineno-12-10" name="__codelineno-12-10"></a><span class="w">  </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">104</span><span class="p">,</span>
<a id="__codelineno-12-11" name="__codelineno-12-11"></a><span class="w">  </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X105&quot;</span>
<a id="__codelineno-12-12" name="__codelineno-12-12"></a><span class="p">}</span>
<a id="__codelineno-12-13" name="__codelineno-12-13"></a>
<a id="__codelineno-12-14" name="__codelineno-12-14"></a><span class="err">###</span>
<a id="__codelineno-12-15" name="__codelineno-12-15"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/demo/Student/delete HTTP/1.1</span>
<a id="__codelineno-12-16" name="__codelineno-12-16"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-12-17" name="__codelineno-12-17"></a>
<a id="__codelineno-12-18" name="__codelineno-12-18"></a><span class="p">[</span><span class="s2">&quot;1&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;2&quot;</span><span class="p">]</span>
<a id="__codelineno-12-19" name="__codelineno-12-19"></a>
<a id="__codelineno-12-20" name="__codelineno-12-20"></a>
<a id="__codelineno-12-21" name="__codelineno-12-21"></a><span class="err">###</span>
<a id="__codelineno-12-22" name="__codelineno-12-22"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/demo/Student/update HTTP/1.1</span>
<a id="__codelineno-12-23" name="__codelineno-12-23"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-12-24" name="__codelineno-12-24"></a>
<a id="__codelineno-12-25" name="__codelineno-12-25"></a><span class="p">{</span>
<a id="__codelineno-12-26" name="__codelineno-12-26"></a><span class="w">  </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X100&quot;</span><span class="p">,</span>
<a id="__codelineno-12-27" name="__codelineno-12-27"></a><span class="w">  </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X101&quot;</span><span class="p">,</span>
<a id="__codelineno-12-28" name="__codelineno-12-28"></a><span class="w">  </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X102&quot;</span><span class="p">,</span>
<a id="__codelineno-12-29" name="__codelineno-12-29"></a><span class="w">  </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X103&quot;</span><span class="p">,</span>
<a id="__codelineno-12-30" name="__codelineno-12-30"></a><span class="w">  </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">104</span><span class="p">,</span>
<a id="__codelineno-12-31" name="__codelineno-12-31"></a><span class="w">  </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X105&quot;</span>
<a id="__codelineno-12-32" name="__codelineno-12-32"></a><span class="p">}</span>
<a id="__codelineno-12-33" name="__codelineno-12-33"></a>
<a id="__codelineno-12-34" name="__codelineno-12-34"></a><span class="err">###</span>
<a id="__codelineno-12-35" name="__codelineno-12-35"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/demo/Student/getPage HTTP/1.1</span>
<a id="__codelineno-12-36" name="__codelineno-12-36"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-12-37" name="__codelineno-12-37"></a>
<a id="__codelineno-12-38" name="__codelineno-12-38"></a><span class="p">{</span>
<a id="__codelineno-12-39" name="__codelineno-12-39"></a><span class="w">    </span><span class="nt">&quot;pageNum&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
<a id="__codelineno-12-40" name="__codelineno-12-40"></a><span class="w">    </span><span class="nt">&quot;pageSize&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span>
<a id="__codelineno-12-41" name="__codelineno-12-41"></a><span class="p">}</span>
</code></pre></div></td></tr></table></div>
</li>
<li>
<p>分别点击各<strong>REST Client</strong>链接，检查返回结果是否正确</p>
</li>
</ol>
<p><code>Stu/api.md</code>中包含各Web Api的使用说明，可据此检查返</p>
<h4 id="_4">学生表</h4>
<h5 id="_5">学生表增</h5>
<p><strong>调用地址：</strong> <a href="http://my_host:8080/Stu/demo/Student/add">http://my_host:8080/Stu/demo/Student/add</a></p>
<p><strong>请求方式：</strong> POST</p>
<p><strong>返回类型：</strong> JSON</p>
<p><strong>请求参数（Headers）</strong></p>
<table>
<thead>
<tr>
<th>参数</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>content-type</td>
<td>application/json</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Query）</strong></p>
<p><strong>请求参数（Body）</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a><span class="p">{</span>
<a id="__codelineno-13-2" name="__codelineno-13-2" href="#__codelineno-13-2"></a><span class="w">  </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//Id</span>
<a id="__codelineno-13-3" name="__codelineno-13-3" href="#__codelineno-13-3"></a><span class="w">  </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//学号</span>
<a id="__codelineno-13-4" name="__codelineno-13-4" href="#__codelineno-13-4"></a><span class="w">  </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//姓名</span>
<a id="__codelineno-13-5" name="__codelineno-13-5" href="#__codelineno-13-5"></a><span class="w">  </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//性别</span>
<a id="__codelineno-13-6" name="__codelineno-13-6" href="#__codelineno-13-6"></a><span class="w">  </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">I</span><span class="kc">nte</span><span class="err">ger</span><span class="p">,</span><span class="w">  </span><span class="c1">//年龄</span>
<a id="__codelineno-13-7" name="__codelineno-13-7" href="#__codelineno-13-7"></a><span class="w">  </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="w">  </span><span class="c1">//所在系</span>
<a id="__codelineno-13-8" name="__codelineno-13-8" href="#__codelineno-13-8"></a><span class="p">}</span>
</code></pre></div>
<p><strong>请求示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/Stu/demo/Student/add HTTP/1.1</span>
<a id="__codelineno-14-2" name="__codelineno-14-2" href="#__codelineno-14-2"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-14-3" name="__codelineno-14-3" href="#__codelineno-14-3"></a>
<a id="__codelineno-14-4" name="__codelineno-14-4" href="#__codelineno-14-4"></a><span class="p">{</span>
<a id="__codelineno-14-5" name="__codelineno-14-5" href="#__codelineno-14-5"></a><span class="w">  </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X100&quot;</span><span class="p">,</span>
<a id="__codelineno-14-6" name="__codelineno-14-6" href="#__codelineno-14-6"></a><span class="w">  </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X101&quot;</span><span class="p">,</span>
<a id="__codelineno-14-7" name="__codelineno-14-7" href="#__codelineno-14-7"></a><span class="w">  </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X102&quot;</span><span class="p">,</span>
<a id="__codelineno-14-8" name="__codelineno-14-8" href="#__codelineno-14-8"></a><span class="w">  </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X103&quot;</span><span class="p">,</span>
<a id="__codelineno-14-9" name="__codelineno-14-9" href="#__codelineno-14-9"></a><span class="w">  </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">104</span><span class="p">,</span>
<a id="__codelineno-14-10" name="__codelineno-14-10" href="#__codelineno-14-10"></a><span class="w">  </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X105&quot;</span>
<a id="__codelineno-14-11" name="__codelineno-14-11" href="#__codelineno-14-11"></a><span class="p">}</span>
</code></pre></div>
<blockquote>
<p>Rest Client请求格式</p>
</blockquote>
<p><strong>正常返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a><span class="p">{</span>
<a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-15-3" name="__codelineno-15-3" href="#__codelineno-15-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;操作成功！&quot;</span><span class="p">,</span>
<a id="__codelineno-15-4" name="__codelineno-15-4" href="#__codelineno-15-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
<a id="__codelineno-15-5" name="__codelineno-15-5" href="#__codelineno-15-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
<a id="__codelineno-15-6" name="__codelineno-15-6" href="#__codelineno-15-6"></a><span class="p">}</span>
</code></pre></div>
<p><strong>失败返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a><span class="p">{</span>
<a id="__codelineno-16-2" name="__codelineno-16-2" href="#__codelineno-16-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1001</span><span class="p">,</span>
<a id="__codelineno-16-3" name="__codelineno-16-3" href="#__codelineno-16-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;创建失败！&quot;</span><span class="p">,</span>
<a id="__codelineno-16-4" name="__codelineno-16-4" href="#__codelineno-16-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;[SQLITE_CONSTRAINT_UNIQUE] A UNIQUE constraint failed (UNIQUE constraint failed: Student.no)&quot;</span><span class="p">,</span>
<a id="__codelineno-16-5" name="__codelineno-16-5" href="#__codelineno-16-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span>
<a id="__codelineno-16-6" name="__codelineno-16-6" href="#__codelineno-16-6"></a><span class="p">}</span>
</code></pre></div>
<p><strong>错误码定义</strong></p>
<table>
<thead>
<tr>
<th>错误码</th>
<th>错误信息</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>成功</td>
<td></td>
</tr>
</tbody>
</table>
<h5 id="_6">学生表删</h5>
<p><strong>调用地址：</strong> <a href="http://my_host:8080/Stu/demo/Student/delete">http://my_host:8080/Stu/demo/Student/delete</a></p>
<p><strong>请求方式：</strong> POST</p>
<p><strong>返回类型：</strong> JSON</p>
<p><strong>请求参数（Headers）</strong></p>
<table>
<thead>
<tr>
<th>参数</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>content-type</td>
<td>application/json</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Query）</strong></p>
<p><strong>请求参数（Body）</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a><span class="p">[</span><span class="s2">&quot;id1&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;id2&quot;</span><span class="p">]</span>
</code></pre></div>
<p><strong>请求示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/Stu/demo/Student/delete HTTP/1.1</span>
<a id="__codelineno-18-2" name="__codelineno-18-2" href="#__codelineno-18-2"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-18-3" name="__codelineno-18-3" href="#__codelineno-18-3"></a>
<a id="__codelineno-18-4" name="__codelineno-18-4" href="#__codelineno-18-4"></a><span class="p">[</span><span class="s2">&quot;1&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;2&quot;</span><span class="p">]</span>
</code></pre></div>
<blockquote>
<p>Rest Client请求格式</p>
</blockquote>
<p><strong>正常返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-19-1" name="__codelineno-19-1" href="#__codelineno-19-1"></a><span class="p">{</span>
<a id="__codelineno-19-2" name="__codelineno-19-2" href="#__codelineno-19-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-19-3" name="__codelineno-19-3" href="#__codelineno-19-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;操作成功！&quot;</span><span class="p">,</span>
<a id="__codelineno-19-4" name="__codelineno-19-4" href="#__codelineno-19-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
<a id="__codelineno-19-5" name="__codelineno-19-5" href="#__codelineno-19-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
<a id="__codelineno-19-6" name="__codelineno-19-6" href="#__codelineno-19-6"></a><span class="p">}</span>
</code></pre></div>
<p><strong>失败返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-20-1" name="__codelineno-20-1" href="#__codelineno-20-1"></a><span class="p">{</span>
<a id="__codelineno-20-2" name="__codelineno-20-2" href="#__codelineno-20-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-20-3" name="__codelineno-20-3" href="#__codelineno-20-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;操作成功！&quot;</span><span class="p">,</span>
<a id="__codelineno-20-4" name="__codelineno-20-4" href="#__codelineno-20-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
<a id="__codelineno-20-5" name="__codelineno-20-5" href="#__codelineno-20-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="c1">//影响行数为0</span>
<a id="__codelineno-20-6" name="__codelineno-20-6" href="#__codelineno-20-6"></a><span class="p">}</span>
</code></pre></div>
<p><strong>错误码定义</strong></p>
<table>
<thead>
<tr>
<th>错误码</th>
<th>错误信息</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>成功</td>
<td></td>
</tr>
</tbody>
</table>
<h5 id="_7">学生表改</h5>
<p><strong>调用地址：</strong> <a href="http://my_host:8080/Stu/demo/Student/update">http://my_host:8080/Stu/demo/Student/update</a></p>
<p><strong>请求方式：</strong> POST</p>
<p><strong>返回类型：</strong> JSON</p>
<p><strong>请求参数（Headers）</strong></p>
<table>
<thead>
<tr>
<th>参数</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>content-type</td>
<td>application/json</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Query）</strong></p>
<p><strong>请求参数（Body）</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-21-1" name="__codelineno-21-1" href="#__codelineno-21-1"></a><span class="p">{</span>
<a id="__codelineno-21-2" name="__codelineno-21-2" href="#__codelineno-21-2"></a><span class="w">  </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//Id</span>
<a id="__codelineno-21-3" name="__codelineno-21-3" href="#__codelineno-21-3"></a><span class="w">  </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//学号</span>
<a id="__codelineno-21-4" name="__codelineno-21-4" href="#__codelineno-21-4"></a><span class="w">  </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//姓名</span>
<a id="__codelineno-21-5" name="__codelineno-21-5" href="#__codelineno-21-5"></a><span class="w">  </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="p">,</span><span class="w">  </span><span class="c1">//性别</span>
<a id="__codelineno-21-6" name="__codelineno-21-6" href="#__codelineno-21-6"></a><span class="w">  </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">I</span><span class="kc">nte</span><span class="err">ger</span><span class="p">,</span><span class="w">  </span><span class="c1">//年龄</span>
<a id="__codelineno-21-7" name="__codelineno-21-7" href="#__codelineno-21-7"></a><span class="w">  </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">S</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g</span><span class="w">  </span><span class="c1">//所在系</span>
<a id="__codelineno-21-8" name="__codelineno-21-8" href="#__codelineno-21-8"></a><span class="p">}</span>
</code></pre></div>
<p><strong>请求示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/Stu/demo/Student/update HTTP/1.1</span>
<a id="__codelineno-22-2" name="__codelineno-22-2" href="#__codelineno-22-2"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-22-3" name="__codelineno-22-3" href="#__codelineno-22-3"></a>
<a id="__codelineno-22-4" name="__codelineno-22-4" href="#__codelineno-22-4"></a><span class="p">{</span>
<a id="__codelineno-22-5" name="__codelineno-22-5" href="#__codelineno-22-5"></a><span class="w">  </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X100&quot;</span><span class="p">,</span>
<a id="__codelineno-22-6" name="__codelineno-22-6" href="#__codelineno-22-6"></a><span class="w">  </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X101&quot;</span><span class="p">,</span>
<a id="__codelineno-22-7" name="__codelineno-22-7" href="#__codelineno-22-7"></a><span class="w">  </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X102&quot;</span><span class="p">,</span>
<a id="__codelineno-22-8" name="__codelineno-22-8" href="#__codelineno-22-8"></a><span class="w">  </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X103&quot;</span><span class="p">,</span>
<a id="__codelineno-22-9" name="__codelineno-22-9" href="#__codelineno-22-9"></a><span class="w">  </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">104</span><span class="p">,</span>
<a id="__codelineno-22-10" name="__codelineno-22-10" href="#__codelineno-22-10"></a><span class="w">  </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X105&quot;</span>
<a id="__codelineno-22-11" name="__codelineno-22-11" href="#__codelineno-22-11"></a><span class="p">}</span>
</code></pre></div>
<blockquote>
<p>Rest Client请求格式</p>
</blockquote>
<p><strong>正常返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a><span class="p">{</span>
<a id="__codelineno-23-2" name="__codelineno-23-2" href="#__codelineno-23-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-23-3" name="__codelineno-23-3" href="#__codelineno-23-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;操作成功！&quot;</span><span class="p">,</span>
<a id="__codelineno-23-4" name="__codelineno-23-4" href="#__codelineno-23-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
<a id="__codelineno-23-5" name="__codelineno-23-5" href="#__codelineno-23-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
<a id="__codelineno-23-6" name="__codelineno-23-6" href="#__codelineno-23-6"></a><span class="p">}</span>
</code></pre></div>
<p><strong>失败返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a><span class="p">{</span>
<a id="__codelineno-24-2" name="__codelineno-24-2" href="#__codelineno-24-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1001</span><span class="p">,</span>
<a id="__codelineno-24-3" name="__codelineno-24-3" href="#__codelineno-24-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;创建失败！&quot;</span><span class="p">,</span>
<a id="__codelineno-24-4" name="__codelineno-24-4" href="#__codelineno-24-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;[SQLITE_CONSTRAINT_UNIQUE] A UNIQUE constraint failed (UNIQUE constraint failed: Student.no)&quot;</span><span class="p">,</span>
<a id="__codelineno-24-5" name="__codelineno-24-5" href="#__codelineno-24-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span>
<a id="__codelineno-24-6" name="__codelineno-24-6" href="#__codelineno-24-6"></a><span class="p">}</span>
</code></pre></div>
<p><strong>错误码定义</strong></p>
<table>
<thead>
<tr>
<th>错误码</th>
<th>错误信息</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>成功</td>
<td></td>
</tr>
</tbody>
</table>
<h5 id="_8">学生表查</h5>
<p><strong>调用地址：</strong> <a href="http://my_host:8080/Stu/demo/Student/getPage">http://my_host:8080/Stu/demo/Student/getPage</a></p>
<p><strong>请求方式：</strong> POST</p>
<p><strong>返回类型：</strong> JSON</p>
<p><strong>请求参数（Headers）</strong></p>
<table>
<thead>
<tr>
<th>参数</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>content-type</td>
<td>application/json</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Query）</strong></p>
<p><strong>请求参数（Body）</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-25-1" name="__codelineno-25-1" href="#__codelineno-25-1"></a><span class="p">{</span>
<a id="__codelineno-25-2" name="__codelineno-25-2" href="#__codelineno-25-2"></a><span class="w">    </span><span class="nt">&quot;pageNum&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">I</span><span class="kc">nte</span><span class="err">ger</span><span class="p">,</span><span class="w"> </span><span class="c1">//页码，从0开始</span>
<a id="__codelineno-25-3" name="__codelineno-25-3" href="#__codelineno-25-3"></a><span class="w">    </span><span class="nt">&quot;pageSize&quot;</span><span class="p">:</span><span class="w"> </span><span class="err">I</span><span class="kc">nte</span><span class="err">ger</span><span class="w"> </span><span class="c1">//页大小</span>
<a id="__codelineno-25-4" name="__codelineno-25-4" href="#__codelineno-25-4"></a><span class="p">}</span>
</code></pre></div>
<p><strong>请求示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-26-1" name="__codelineno-26-1" href="#__codelineno-26-1"></a><span class="err">POST</span><span class="w"> </span><span class="err">h</span><span class="kc">tt</span><span class="err">p</span><span class="p">:</span><span class="c1">//localhost:8080/Stu/demo/Student/getPage HTTP/1.1</span>
<a id="__codelineno-26-2" name="__codelineno-26-2" href="#__codelineno-26-2"></a><span class="err">co</span><span class="kc">ntent</span><span class="mi">-</span><span class="kc">t</span><span class="err">ype</span><span class="p">:</span><span class="w"> </span><span class="err">applica</span><span class="kc">t</span><span class="err">io</span><span class="kc">n</span><span class="err">/jso</span><span class="kc">n</span>
<a id="__codelineno-26-3" name="__codelineno-26-3" href="#__codelineno-26-3"></a>
<a id="__codelineno-26-4" name="__codelineno-26-4" href="#__codelineno-26-4"></a><span class="p">{</span>
<a id="__codelineno-26-5" name="__codelineno-26-5" href="#__codelineno-26-5"></a><span class="w">    </span><span class="nt">&quot;pageNum&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
<a id="__codelineno-26-6" name="__codelineno-26-6" href="#__codelineno-26-6"></a><span class="w">    </span><span class="nt">&quot;pageSize&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span>
<a id="__codelineno-26-7" name="__codelineno-26-7" href="#__codelineno-26-7"></a><span class="p">}</span>
</code></pre></div>
<blockquote>
<p>Rest Client请求格式</p>
</blockquote>
<p><strong>正常返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-27-1" name="__codelineno-27-1" href="#__codelineno-27-1"></a><span class="p">{</span>
<a id="__codelineno-27-2" name="__codelineno-27-2" href="#__codelineno-27-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-27-3" name="__codelineno-27-3" href="#__codelineno-27-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;操作成功！&quot;</span><span class="p">,</span>
<a id="__codelineno-27-4" name="__codelineno-27-4" href="#__codelineno-27-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
<a id="__codelineno-27-5" name="__codelineno-27-5" href="#__codelineno-27-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-27-6" name="__codelineno-27-6" href="#__codelineno-27-6"></a><span class="w">    </span><span class="nt">&quot;total&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span>
<a id="__codelineno-27-7" name="__codelineno-27-7" href="#__codelineno-27-7"></a><span class="w">    </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
<a id="__codelineno-27-8" name="__codelineno-27-8" href="#__codelineno-27-8"></a><span class="w">      </span><span class="p">{</span>
<a id="__codelineno-27-9" name="__codelineno-27-9" href="#__codelineno-27-9"></a><span class="w">        </span><span class="nt">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X100&quot;</span><span class="p">,</span>
<a id="__codelineno-27-10" name="__codelineno-27-10" href="#__codelineno-27-10"></a><span class="w">        </span><span class="nt">&quot;no&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X101&quot;</span><span class="p">,</span>
<a id="__codelineno-27-11" name="__codelineno-27-11" href="#__codelineno-27-11"></a><span class="w">        </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X102&quot;</span><span class="p">,</span>
<a id="__codelineno-27-12" name="__codelineno-27-12" href="#__codelineno-27-12"></a><span class="w">        </span><span class="nt">&quot;gender&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X103&quot;</span><span class="p">,</span>
<a id="__codelineno-27-13" name="__codelineno-27-13" href="#__codelineno-27-13"></a><span class="w">        </span><span class="nt">&quot;age&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">104</span><span class="p">,</span>
<a id="__codelineno-27-14" name="__codelineno-27-14" href="#__codelineno-27-14"></a><span class="w">        </span><span class="nt">&quot;dept&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;X105&quot;</span>
<a id="__codelineno-27-15" name="__codelineno-27-15" href="#__codelineno-27-15"></a><span class="w">      </span><span class="p">}</span>
<a id="__codelineno-27-16" name="__codelineno-27-16" href="#__codelineno-27-16"></a><span class="w">    </span><span class="p">]</span>
<a id="__codelineno-27-17" name="__codelineno-27-17" href="#__codelineno-27-17"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-27-18" name="__codelineno-27-18" href="#__codelineno-27-18"></a><span class="p">}</span>
</code></pre></div>
<p><strong>失败返回示例</strong></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-28-1" name="__codelineno-28-1" href="#__codelineno-28-1"></a><span class="p">{</span>
<a id="__codelineno-28-2" name="__codelineno-28-2" href="#__codelineno-28-2"></a><span class="w">  </span><span class="nt">&quot;code&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-28-3" name="__codelineno-28-3" href="#__codelineno-28-3"></a><span class="w">  </span><span class="nt">&quot;message&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;操作成功！&quot;</span><span class="p">,</span>
<a id="__codelineno-28-4" name="__codelineno-28-4" href="#__codelineno-28-4"></a><span class="w">  </span><span class="nt">&quot;detail&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
<a id="__codelineno-28-5" name="__codelineno-28-5" href="#__codelineno-28-5"></a><span class="w">  </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<a id="__codelineno-28-6" name="__codelineno-28-6" href="#__codelineno-28-6"></a><span class="w">    </span><span class="nt">&quot;total&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<a id="__codelineno-28-7" name="__codelineno-28-7" href="#__codelineno-28-7"></a><span class="w">    </span><span class="nt">&quot;data&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span>
<a id="__codelineno-28-8" name="__codelineno-28-8" href="#__codelineno-28-8"></a><span class="w">  </span><span class="p">}</span>
<a id="__codelineno-28-9" name="__codelineno-28-9" href="#__codelineno-28-9"></a><span class="p">}</span>
</code></pre></div>
<p><strong>错误码定义</strong></p>
<table>
<thead>
<tr>
<th>错误码</th>
<th>错误信息</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>成功</td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="_9">参考文献</h3>
<ol>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8EAndroid%E7%9A%84%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E5%87%8C%E8%80%80%E5%A6%82.pdf">基于Android的学生信息管理系统设计与实现_凌耀如</a></p>
</li>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8EB_S%E7%BB%93%E6%9E%84%E7%9A%84%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E7%86%8A%E9%94%A6%E8%BE%89.pdf">基于B_S结构的学生信息管理系统的设计与实现_熊锦辉</a></p>
</li>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8EJava_Web%E7%9A%84%E5%AD%A6%E7%94%9F%E6%88%90%E7%BB%A9%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F_%E6%9D%A8%E5%AE%9D%E6%9E%97.pdf">基于Java_Web的学生成绩信息管理系统_杨宝林</a></p>
</li>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8ESpring_Boot...%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E6%9D%A8%E4%B8%9C.pdf">基于Spring_Boot...生信息管理系统的设计与实现_杨东</a></p>
</li>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8ESSH%E6%A1%86%E6%9E%B6%E7%9A%84%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%A0%94%E7%A9%B6%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E6%B1%A4%E5%81%A5%E5%93%B2.pdf">基于SSH框架的学生信息管理系统的研究与实现_汤健哲</a></p>
</li>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8EUML%E7%9A%84%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%A0%94%E7%A9%B6%E4%B8%8E%E8%AE%BE%E8%AE%A1_%E8%B5%B5%E6%A5%A0%E6%A5%A0.pdf">基于UML的学生信息管理系统的研究与设计_赵楠楠</a></p>
</li>
<li>
<p><a href="references/%E5%9F%BA%E4%BA%8EWEB%E7%9A%84%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E7%8E%8B%E8%8B%B1%E5%90%88.pdf">基于WEB的学生信息管理系统设计与实现_王英合</a></p>
</li>
<li>
<p><a href="references/%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%BC%80%E5%8F%91_%E5%91%A8%E5%BF%86.pdf">学生信息管理系统的设计与开发_周忆</a></p>
</li>
<li>
<p><a href="references/%E6%B8%85%E5%8D%8E%E5%A4%A7%E5%AD%A6%E7%BB%BC%E5%90%88%E6%95%99%E5%8A%A1%E7%B3%BB%E7%BB%9F%E5%9C%A8%E6%95%99%E5%8A%A1%E7%AE%A1%E7%90%86%E4%B8%AD%E7%9A%84%E5%BA%94%E7%94%A8_%E5%AE%A3%E5%8D%8E.pdf">清华大学综合教务系统在教务管理中的应用_宣华</a></p>
</li>
<li>
<p><a href="references/%E9%AB%98%E6%A0%A1%E5%AD%A6%E7%94%9F%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E7%8E%8B%E7%A3%8A.pdf">高校学生信息管理系统的设计与实现_王磊</a></p>
</li>
<li>
<p><a href="references/%E9%AB%98%E6%A0%A1%E5%AD%A6%E7%94%9F%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0_%E8%92%8B%E5%8F%8B%E6%AD%A3.pdf">高校学生管理系统的设计与实现_蒋友正</a></p>
</li>
</ol>












                
              </article>
            </div>
          
          
  <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>

<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
        </div>
        
      </main>
      
        <footer class="md-footer">
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-copyright">
  
  
    Made with
    <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
      Material for MkDocs
    </a>
  
</div>
      
    </div>
  </div>
</footer>
      
    </div>
    <div class="md-dialog" data-md-component="dialog">
      <div class="md-dialog__inner md-typeset"></div>
    </div>
    
    
    <script id="__config" type="application/json">{"base": "../..", "features": ["content.code.copy", "content.tabs.link", "navigation.expand", "navigation.sections", "navigation.path"], "search": "../../assets/javascripts/workers/search.f8cc74c7.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
    
    
      <script src="../../assets/javascripts/bundle.f1b6f286.min.js"></script>
      
    
  </body>
</html>